[libvirt] [PATCH 00/89] configure cleanup and improvements

Few bug fixes found along the way. Introduces new macro helpers to unify the configure.ac and m4 files. Moves libraries and drivers checks to its own files to clean the configure.ac. Pavel Hrdina (89): m4/virt-netcf: fix bug where we overwrite LIBS configure: fix wireshark dissector configure output configure: move external programs check to its own file m4/virt: create result macros for the remaining virt check m4/virt: use LIBVIRT_RESULT macro instead of AC_MSG_NOTICE m4/virt-lib: introduce LIBVIRT_ARG_WITH(_ALT) macro m4/virt-lib: introduce LIBVIRT_ARG_ENABLE macro configure: use LIBVIRT_ARG_WITH(_ALT) macros configure: use LIBVIRT_ARG_ENABLE macro m4/virt-lib: move LIBVIRT_ARG_WITH out of LIBVIRT_CHECK_(LIB|LIB_ALT|PKG) m4/virt: introduce LIBVIRT_ARG_* macros for all library checks m4/virt-lib: add new parameter to override default fail action configure: move libxml check to its own file m4/virt-libxml: use only pkg-config to check for libxml2 m4/virt-libxml: use LIBVIRT_CHECK_PKG configure: move dlopen check to its own file configure: move with-driver-modules check to its own file configure: move firewalld check to its own file configure: move polkit check to its own file configure: move pthread check it its own file configure: move atomic check to its onw file configure: move XDR check to its own file configure: move libpcap check to its own file m4/virt-libpcap: remove unreasonable dependency on QEMU m4/virt-libpcap: error out if asked for libpcap but it was not found configure: move macvtap check to its own file configure: move virtualport check to its own file configure: move libnl check to its own file configure: move windows common check to its own file configure: move Cygwin check to its own file configure: move MinGW check to its own file configure: move windows symbols check to its own file configure: move windres check to its own file configure: move version script check to one place configure: move nwfilter check to its own file configure: move pm-utils check to its own file configure: move devmapper check to its own file m4/virt-devmapper: use LIBVIRT_CHECK_(PKG|LIB) configure: move libparted check to its own file m4/virt-parted: use LIBVIRT_CHECK_PKG configure: group all library checks together configure: move DTrace check to its own file configure: move numad check to its own file configure: move sysctl config check to its own file configure: move chrdev lock files check to its own file configure: move loader/nvram check to its own file configure: move default editor check to its own file configure: move TLS priority check to its own file configure: move xml catalog file check to its own file configure: move debug check to its own file configure: group all Miscellaneous check together configure: move OpenVZ driver check to its own file configure: move VMware driver check to its own file configure: move QEMU driver check to its own file configure: move qemu privileges check to qemu driver file configure: move qemu bridge helper check to qemu driver file configure: move LXC driver check to its own file configure: move XEN driver check to its own file configure: move libxl driver check to its own file m4/virt-libxl: use LIBVIRT_CHECK_(PKG|LIB) macros m4/virt-libxl: properly check for required libxl version m4/virt-libxl: cleanup storing CFLAGS and LIBS variables configure: move XenAPI driver check to its own file m4/virt-driver-xenapi: use LIBVIRT_CHECK_LIB macro configure: move PHYP driver check to its own file configure: move test driver check to its own file configure: move remote driver check to its own file configure: move vbox driver check to its own file configure: move ESX driver check to its own file configure: move Hyper-V driver check to its own file configure: move libvirtd driver check to its own file configure: move network driver check to its own file configure: move interface driver check to its own file configure: move parallels version definition to m4/virt-driver-vz configure: group all virtualization drivers together configure: move SELinux secdriver check into its own file configure: move AppArmor secdriver check to its own file configure: move storage dir check to its own file configure: move storage fs check to its own file configure: move storage LVM check to its own file configure: move storage iSCSI check to its own file configure: move storage SCSI check to its own file configure: move storage mpath check to its own file configure: move storage disk check to its own file configure: move storage RBD check to its own file configure: move storage Sheepdog check to its own file configure: move storage Gluster check to its own file configure: move storage ZFS check to its own file configure: group all storage driver check together config-post.h | 4 +- configure.ac | 2340 ++++++----------------------------------- m4/virt-apparmor.m4 | 11 +- m4/virt-atomic.m4 | 77 ++ m4/virt-attr.m4 | 4 + m4/virt-audit.m4 | 4 + m4/virt-avahi.m4 | 4 + m4/virt-blkid.m4 | 4 + m4/virt-capng.m4 | 4 + m4/virt-chrdev-lock-files.m4 | 52 + m4/virt-compile-warnings.m4 | 20 +- m4/virt-curl.m4 | 4 + m4/virt-dbus.m4 | 4 + m4/virt-debug.m4 | 33 + m4/virt-default-editor.m4 | 32 + m4/virt-devmapper.m4 | 31 + m4/virt-dlopen.m4 | 45 + m4/virt-driver-bhyve.m4 | 11 +- m4/virt-driver-esx.m4 | 57 + m4/virt-driver-hyperv.m4 | 47 + m4/virt-driver-interface.m4 | 49 + m4/virt-driver-libvirtd.m4 | 33 + m4/virt-driver-libxl.m4 | 97 ++ m4/virt-driver-lxc.m4 | 74 ++ m4/virt-driver-modules.m4 | 58 + m4/virt-driver-network.m4 | 51 + m4/virt-driver-openvz.m4 | 42 + m4/virt-driver-phyp.m4 | 48 + m4/virt-driver-qemu.m4 | 68 ++ m4/virt-driver-remote.m4 | 33 + m4/virt-driver-test.m4 | 33 + m4/virt-driver-uml.m4 | 11 +- m4/virt-driver-vbox.m4 | 44 + m4/virt-driver-vmware.m4 | 33 + m4/virt-driver-vz.m4 | 11 +- m4/virt-driver-xen.m4 | 126 +++ m4/virt-driver-xenapi.m4 | 48 + m4/virt-dtrace.m4 | 45 + m4/virt-external-programs.m4 | 95 ++ m4/virt-firewalld.m4 | 43 + m4/virt-fuse.m4 | 4 + m4/virt-gluster.m4 | 4 + m4/virt-gnutls.m4 | 4 + m4/virt-hal.m4 | 4 + m4/virt-host-validate.m4 | 13 +- m4/virt-init-script.m4 | 12 +- m4/virt-lib.m4 | 179 +++- m4/virt-libnl.m4 | 81 ++ m4/virt-libpcap.m4 | 62 ++ m4/virt-libssh.m4 | 4 + m4/virt-libxml.m4 | 50 + m4/virt-loader-nvram.m4 | 41 + m4/virt-login-shell.m4 | 14 +- m4/virt-macvtap.m4 | 56 + m4/virt-netcf.m4 | 6 +- m4/virt-nss.m4 | 11 +- m4/virt-numactl.m4 | 4 + m4/virt-numad.m4 | 58 + m4/virt-nwfilter.m4 | 32 + m4/virt-openwsman.m4 | 4 + m4/virt-parted.m4 | 38 + m4/virt-pciaccess.m4 | 4 + m4/virt-pm-utils.m4 | 45 + m4/virt-polkit.m4 | 107 ++ m4/virt-pthread.m4 | 56 + m4/virt-readline.m4 | 4 + m4/virt-sanlock.m4 | 4 + m4/virt-sasl.m4 | 4 + m4/virt-secdriver-apparmor.m4 | 50 + m4/virt-secdriver-selinux.m4 | 63 ++ m4/virt-selinux.m4 | 11 +- m4/virt-ssh2.m4 | 4 + m4/virt-storage-dir.m4 | 33 + m4/virt-storage-disk.m4 | 58 + m4/virt-storage-fs.m4 | 89 ++ m4/virt-storage-gluster.m4 | 43 + m4/virt-storage-iscsi.m4 | 50 + m4/virt-storage-lvm.m4 | 90 ++ m4/virt-storage-mpath.m4 | 53 + m4/virt-storage-rbd.m4 | 49 + m4/virt-storage-scsi.m4 | 36 + m4/virt-storage-sheepdog.m4 | 56 + m4/virt-storage-zfs.m4 | 56 + m4/virt-sysctl.m4 | 43 + m4/virt-tls-priority.m4 | 33 + m4/virt-udev.m4 | 4 + m4/virt-virtualport.m4 | 65 ++ m4/virt-win-common.m4 | 44 + m4/virt-win-cygwin.m4 | 32 + m4/virt-win-mingw.m4 | 28 + m4/virt-win-symbols.m4 | 40 + m4/virt-win-windres.m4 | 34 + m4/virt-wireshark.m4 | 12 +- m4/virt-xdr.m4 | 60 ++ m4/virt-xml-catalog.m4 | 33 + m4/virt-yajl.m4 | 4 + src/Makefile.am | 10 +- src/util/virutil.c | 4 +- 98 files changed, 3776 insertions(+), 2146 deletions(-) create mode 100644 m4/virt-atomic.m4 create mode 100644 m4/virt-chrdev-lock-files.m4 create mode 100644 m4/virt-debug.m4 create mode 100644 m4/virt-default-editor.m4 create mode 100644 m4/virt-devmapper.m4 create mode 100644 m4/virt-dlopen.m4 create mode 100644 m4/virt-driver-esx.m4 create mode 100644 m4/virt-driver-hyperv.m4 create mode 100644 m4/virt-driver-interface.m4 create mode 100644 m4/virt-driver-libvirtd.m4 create mode 100644 m4/virt-driver-libxl.m4 create mode 100644 m4/virt-driver-lxc.m4 create mode 100644 m4/virt-driver-modules.m4 create mode 100644 m4/virt-driver-network.m4 create mode 100644 m4/virt-driver-openvz.m4 create mode 100644 m4/virt-driver-phyp.m4 create mode 100644 m4/virt-driver-qemu.m4 create mode 100644 m4/virt-driver-remote.m4 create mode 100644 m4/virt-driver-test.m4 create mode 100644 m4/virt-driver-vbox.m4 create mode 100644 m4/virt-driver-vmware.m4 create mode 100644 m4/virt-driver-xen.m4 create mode 100644 m4/virt-driver-xenapi.m4 create mode 100644 m4/virt-dtrace.m4 create mode 100644 m4/virt-external-programs.m4 create mode 100644 m4/virt-firewalld.m4 create mode 100644 m4/virt-libnl.m4 create mode 100644 m4/virt-libpcap.m4 create mode 100644 m4/virt-libxml.m4 create mode 100644 m4/virt-loader-nvram.m4 create mode 100644 m4/virt-macvtap.m4 create mode 100644 m4/virt-numad.m4 create mode 100644 m4/virt-nwfilter.m4 create mode 100644 m4/virt-parted.m4 create mode 100644 m4/virt-pm-utils.m4 create mode 100644 m4/virt-polkit.m4 create mode 100644 m4/virt-pthread.m4 create mode 100644 m4/virt-secdriver-apparmor.m4 create mode 100644 m4/virt-secdriver-selinux.m4 create mode 100644 m4/virt-storage-dir.m4 create mode 100644 m4/virt-storage-disk.m4 create mode 100644 m4/virt-storage-fs.m4 create mode 100644 m4/virt-storage-gluster.m4 create mode 100644 m4/virt-storage-iscsi.m4 create mode 100644 m4/virt-storage-lvm.m4 create mode 100644 m4/virt-storage-mpath.m4 create mode 100644 m4/virt-storage-rbd.m4 create mode 100644 m4/virt-storage-scsi.m4 create mode 100644 m4/virt-storage-sheepdog.m4 create mode 100644 m4/virt-storage-zfs.m4 create mode 100644 m4/virt-sysctl.m4 create mode 100644 m4/virt-tls-priority.m4 create mode 100644 m4/virt-virtualport.m4 create mode 100644 m4/virt-win-common.m4 create mode 100644 m4/virt-win-cygwin.m4 create mode 100644 m4/virt-win-mingw.m4 create mode 100644 m4/virt-win-symbols.m4 create mode 100644 m4/virt-win-windres.m4 create mode 100644 m4/virt-xdr.m4 create mode 100644 m4/virt-xml-catalog.m4 -- 2.11.0

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-netcf.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/virt-netcf.m4 b/m4/virt-netcf.m4 index 8d123c75ac..7e0ee83fc5 100644 --- a/m4/virt-netcf.m4 +++ b/m4/virt-netcf.m4 @@ -22,7 +22,7 @@ AC_DEFUN([LIBVIRT_CHECK_NETCF],[ if test "$with_netcf" = "yes" ; then old_CFLAGS="$CFLAGS" - old_LIBS="$CFLAGS" + old_LIBS="$LIBS" CFLAGS="$CFLAGS $NETCF_CFLAGS" LIBS="$LIBS $NETCF_LIBS" AC_CHECK_FUNC([ncf_change_begin], [netcf_transactions=1], [netcf_transactions=0]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:29 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-netcf.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/m4/virt-netcf.m4 b/m4/virt-netcf.m4 index 8d123c75ac..7e0ee83fc5 100644 --- a/m4/virt-netcf.m4 +++ b/m4/virt-netcf.m4 @@ -22,7 +22,7 @@ AC_DEFUN([LIBVIRT_CHECK_NETCF],[
if test "$with_netcf" = "yes" ; then old_CFLAGS="$CFLAGS" - old_LIBS="$CFLAGS" + old_LIBS="$LIBS" CFLAGS="$CFLAGS $NETCF_CFLAGS" LIBS="$LIBS $NETCF_LIBS" AC_CHECK_FUNC([ncf_change_begin], [netcf_transactions=1], [netcf_transactions=0])
ACK Jirka

Commit 373973206aa moved wireshark dissector code to its own file but forget to properly update configure. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index cb96df73bb..dcaa414c70 100644 --- a/configure.ac +++ b/configure.ac @@ -2680,7 +2680,6 @@ LIBVIRT_RESULT_SASL LIBVIRT_RESULT_SELINUX LIBVIRT_RESULT_SSH2 LIBVIRT_RESULT_UDEV -LIBVIRT_RESULT_WIRESHARK LIBVIRT_RESULT_YAJL AC_MSG_NOTICE([ libxml: $LIBXML_CFLAGS $LIBXML_LIBS]) AC_MSG_NOTICE([ dlopen: $DLOPEN_LIBS]) @@ -2760,7 +2759,7 @@ AC_MSG_NOTICE([ TLS priority: $with_tls_priority]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Developer Tools]) AC_MSG_NOTICE([]) -AC_MSG_NOTICE([Wireshark dissector: $with_wireshark_dissector]) +LIBVIRT_RESULT_WIRESHARK AC_MSG_NOTICE([]) AC_MSG_NOTICE([Privileges]) AC_MSG_NOTICE([]) -- 2.11.0

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 93 ++++--------------------------------------- m4/virt-external-programs.m4 | 95 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 86 deletions(-) create mode 100644 m4/virt-external-programs.m4 diff --git a/configure.ac b/configure.ac index dcaa414c70..af94d18673 100644 --- a/configure.ac +++ b/configure.ac @@ -407,80 +407,13 @@ AM_CONDITIONAL([HAVE_LIBTASN1], [test "x$ac_cv_header_libtasn1_h" = "xyes"]) AC_CHECK_LIB([intl],[gettext],[]) -dnl Do we have rpcgen? -AC_PATH_PROGS([RPCGEN], [rpcgen portable-rpcgen], [no]) -AM_CONDITIONAL([HAVE_RPCGEN], [test "x$ac_cv_path_RPCGEN" != "xno"]) - -dnl Miscellaneous external programs. -AC_PATH_PROG([XMLLINT], [xmllint], [/usr/bin/xmllint]) -AC_PATH_PROG([XMLCATALOG], [xmlcatalog], [/usr/bin/xmlcatalog]) -AC_PATH_PROG([XSLTPROC], [xsltproc], [/usr/bin/xsltproc]) -AC_PATH_PROG([AUGPARSE], [augparse], [/usr/bin/augparse]) -AC_PROG_MKDIR_P -AC_PROG_LN_S - -dnl External programs that we can use if they are available. -dnl We will hard-code paths to these programs unless we cannot -dnl detect them, in which case we'll search for the program -dnl along the $PATH at runtime and fail if it's not there. -AC_PATH_PROG([DMIDECODE], [dmidecode], [dmidecode], - [$LIBVIRT_SBIN_PATH]) -AC_PATH_PROG([DNSMASQ], [dnsmasq], [dnsmasq], - [$LIBVIRT_SBIN_PATH]) -AC_PATH_PROG([RADVD], [radvd], [radvd], - [$LIBVIRT_SBIN_PATH]) -AC_PATH_PROG([TC], [tc], [tc], - [$LIBVIRT_SBIN_PATH]) -AC_PATH_PROG([UDEVADM], [udevadm], [], - [$LIBVIRT_SBIN_PATH]) -AC_PATH_PROG([UDEVSETTLE], [udevsettle], [], - [$LIBVIRT_SBIN_PATH]) -AC_PATH_PROG([MODPROBE], [modprobe], [modprobe], - [$LIBVIRT_SBIN_PATH]) -AC_PATH_PROG([RMMOD], [rmmod], [rmmod], - [$LIBVIRT_SBIN_PATH]) -AC_PATH_PROG([MMCTL], [mm-ctl], [mm-ctl], - [$LIBVIRT_SBIN_PATH]) -AC_PATH_PROG([OVSVSCTL], [ovs-vsctl], [ovs-vsctl], - [$LIBVIRT_SBIN_PATH]) -AC_PATH_PROG([SCRUB], [scrub], [scrub], - [$LIBVIRT_SBIN_PATH]) -AC_PATH_PROG([ADDR2LINE], [addr2line], [addr2line], - [$LIBVIRT_SBIN_PATH]) - -AC_DEFINE_UNQUOTED([DMIDECODE],["$DMIDECODE"], - [Location or name of the dmidecode program]) -AC_DEFINE_UNQUOTED([DNSMASQ],["$DNSMASQ"], - [Location or name of the dnsmasq program]) -AC_DEFINE_UNQUOTED([RADVD],["$RADVD"], - [Location or name of the radvd program]) -AC_DEFINE_UNQUOTED([TC],["$TC"], - [Location or name of the tc program (see iproute2)]) -AC_DEFINE_UNQUOTED([MMCTL],["$MMCTL"], - [Location or name of the mm-ctl program]) -AC_DEFINE_UNQUOTED([OVSVSCTL],["$OVSVSCTL"], - [Location or name of the ovs-vsctl program]) - -if test -n "$UDEVADM"; then - AC_DEFINE_UNQUOTED([UDEVADM],["$UDEVADM"], - [Location or name of the udevadm program]) -fi -if test -n "$UDEVSETTLE"; then - AC_DEFINE_UNQUOTED([UDEVSETTLE],["$UDEVSETTLE"], - [Location or name of the udevsettle program]) -fi -if test -n "$MODPROBE"; then - AC_DEFINE_UNQUOTED([MODPROBE],["$MODPROBE"], - [Location or name of the modprobe program]) -fi -if test -n "$RMMOD"; then - AC_DEFINE_UNQUOTED([RMMOD],["$RMMOD"], - [Location or name of the rmmod program]) -fi -AC_DEFINE_UNQUOTED([SCRUB],["$SCRUB"], - [Location or name of the scrub program (for wiping algorithms)]) -AC_DEFINE_UNQUOTED([ADDR2LINE],["$ADDR2LINE"], - [Location of addr2line program]) + +dnl +dnl Check for external programs +dnl + +LIBVIRT_CHECK_EXTERNAL_PROGRAMS + dnl Specific dir for HTML output ? AC_ARG_WITH([html-dir], [AS_HELP_STRING([--with-html-dir=path], @@ -627,18 +560,6 @@ fi AM_CONDITIONAL([WITH_SYSCTL], test "$with_sysctl" = "yes") AC_MSG_RESULT($with_sysctl) -AC_PATH_PROG([IP_PATH], [ip], /sbin/ip, [$LIBVIRT_SBIN_PATH]) -AC_DEFINE_UNQUOTED([IP_PATH], "$IP_PATH", [path to ip binary]) - -AC_PATH_PROG([IPTABLES_PATH], [iptables], /sbin/iptables, [$LIBVIRT_SBIN_PATH]) -AC_DEFINE_UNQUOTED([IPTABLES_PATH], "$IPTABLES_PATH", [path to iptables binary]) - -AC_PATH_PROG([IP6TABLES_PATH], [ip6tables], /sbin/ip6tables, [$LIBVIRT_SBIN_PATH]) -AC_DEFINE_UNQUOTED([IP6TABLES_PATH], "$IP6TABLES_PATH", [path to ip6tables binary]) - -AC_PATH_PROG([EBTABLES_PATH], [ebtables], /sbin/ebtables, [$LIBVIRT_SBIN_PATH]) -AC_DEFINE_UNQUOTED([EBTABLES_PATH], "$EBTABLES_PATH", [path to ebtables binary]) - dnl dnl Checks for the OpenVZ driver diff --git a/m4/virt-external-programs.m4 b/m4/virt-external-programs.m4 new file mode 100644 index 0000000000..41a6c2d6ad --- /dev/null +++ b/m4/virt-external-programs.m4 @@ -0,0 +1,95 @@ +dnl The External programs check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_EXTERNAL_PROGRAMS], [ + dnl Do we have rpcgen? + AC_PATH_PROGS([RPCGEN], [rpcgen portable-rpcgen], [no]) + AM_CONDITIONAL([HAVE_RPCGEN], [test "x$ac_cv_path_RPCGEN" != "xno"]) + + dnl Miscellaneous external programs. + AC_PATH_PROG([XMLLINT], [xmllint], [/usr/bin/xmllint]) + AC_PATH_PROG([XMLCATALOG], [xmlcatalog], [/usr/bin/xmlcatalog]) + AC_PATH_PROG([XSLTPROC], [xsltproc], [/usr/bin/xsltproc]) + AC_PATH_PROG([AUGPARSE], [augparse], [/usr/bin/augparse]) + AC_PROG_MKDIR_P + AC_PROG_LN_S + + dnl External programs that we can use if they are available. + dnl We will hard-code paths to these programs unless we cannot + dnl detect them, in which case we'll search for the program + dnl along the $PATH at runtime and fail if it's not there. + AC_PATH_PROG([DMIDECODE], [dmidecode], [dmidecode], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([DNSMASQ], [dnsmasq], [dnsmasq], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([RADVD], [radvd], [radvd], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([TC], [tc], [tc], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([UDEVADM], [udevadm], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([UDEVSETTLE], [udevsettle], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([MODPROBE], [modprobe], [modprobe], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([RMMOD], [rmmod], [rmmod], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([MMCTL], [mm-ctl], [mm-ctl], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([OVSVSCTL], [ovs-vsctl], [ovs-vsctl], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([SCRUB], [scrub], [scrub], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([ADDR2LINE], [addr2line], [addr2line], [$LIBVIRT_SBIN_PATH]) + + AC_DEFINE_UNQUOTED([DMIDECODE],["$DMIDECODE"], + [Location or name of the dmidecode program]) + AC_DEFINE_UNQUOTED([DNSMASQ],["$DNSMASQ"], + [Location or name of the dnsmasq program]) + AC_DEFINE_UNQUOTED([RADVD],["$RADVD"], + [Location or name of the radvd program]) + AC_DEFINE_UNQUOTED([TC],["$TC"], + [Location or name of the tc program (see iproute2)]) + AC_DEFINE_UNQUOTED([MMCTL],["$MMCTL"], + [Location or name of the mm-ctl program]) + AC_DEFINE_UNQUOTED([OVSVSCTL],["$OVSVSCTL"], + [Location or name of the ovs-vsctl program]) + + if test -n "$UDEVADM"; then + AC_DEFINE_UNQUOTED([UDEVADM],["$UDEVADM"], + [Location or name of the udevadm program]) + fi + if test -n "$UDEVSETTLE"; then + AC_DEFINE_UNQUOTED([UDEVSETTLE],["$UDEVSETTLE"], + [Location or name of the udevsettle program]) + fi + if test -n "$MODPROBE"; then + AC_DEFINE_UNQUOTED([MODPROBE],["$MODPROBE"], + [Location or name of the modprobe program]) + fi + if test -n "$RMMOD"; then + AC_DEFINE_UNQUOTED([RMMOD],["$RMMOD"], + [Location or name of the rmmod program]) + fi + AC_DEFINE_UNQUOTED([SCRUB],["$SCRUB"], + [Location or name of the scrub program (for wiping algorithms)]) + AC_DEFINE_UNQUOTED([ADDR2LINE],["$ADDR2LINE"], + [Location of addr2line program]) + + AC_PATH_PROG([IP_PATH], [ip], /sbin/ip, [$LIBVIRT_SBIN_PATH]) + AC_DEFINE_UNQUOTED([IP_PATH], "$IP_PATH", [path to ip binary]) + + AC_PATH_PROG([IPTABLES_PATH], [iptables], /sbin/iptables, [$LIBVIRT_SBIN_PATH]) + AC_DEFINE_UNQUOTED([IPTABLES_PATH], "$IPTABLES_PATH", [path to iptables binary]) + + AC_PATH_PROG([IP6TABLES_PATH], [ip6tables], /sbin/ip6tables, [$LIBVIRT_SBIN_PATH]) + AC_DEFINE_UNQUOTED([IP6TABLES_PATH], "$IP6TABLES_PATH", [path to ip6tables binary]) + + AC_PATH_PROG([EBTABLES_PATH], [ebtables], /sbin/ebtables, [$LIBVIRT_SBIN_PATH]) + AC_DEFINE_UNQUOTED([EBTABLES_PATH], "$EBTABLES_PATH", [path to ebtables binary]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:31 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 93 ++++--------------------------------------- m4/virt-external-programs.m4 | 95 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 86 deletions(-) create mode 100644 m4/virt-external-programs.m4 ... + + AC_DEFINE_UNQUOTED([DMIDECODE],["$DMIDECODE"],
While touching this, please put a space after the comma between the first and the second argument. Twelve times :-)
+ [Location or name of the dmidecode program]) + AC_DEFINE_UNQUOTED([DNSMASQ],["$DNSMASQ"], + [Location or name of the dnsmasq program]) + AC_DEFINE_UNQUOTED([RADVD],["$RADVD"], + [Location or name of the radvd program]) + AC_DEFINE_UNQUOTED([TC],["$TC"], + [Location or name of the tc program (see iproute2)]) + AC_DEFINE_UNQUOTED([MMCTL],["$MMCTL"], + [Location or name of the mm-ctl program]) + AC_DEFINE_UNQUOTED([OVSVSCTL],["$OVSVSCTL"], + [Location or name of the ovs-vsctl program]) + + if test -n "$UDEVADM"; then + AC_DEFINE_UNQUOTED([UDEVADM],["$UDEVADM"], + [Location or name of the udevadm program]) + fi + if test -n "$UDEVSETTLE"; then + AC_DEFINE_UNQUOTED([UDEVSETTLE],["$UDEVSETTLE"], + [Location or name of the udevsettle program]) + fi + if test -n "$MODPROBE"; then + AC_DEFINE_UNQUOTED([MODPROBE],["$MODPROBE"], + [Location or name of the modprobe program]) + fi + if test -n "$RMMOD"; then + AC_DEFINE_UNQUOTED([RMMOD],["$RMMOD"], + [Location or name of the rmmod program]) + fi + AC_DEFINE_UNQUOTED([SCRUB],["$SCRUB"], + [Location or name of the scrub program (for wiping algorithms)]) + AC_DEFINE_UNQUOTED([ADDR2LINE],["$ADDR2LINE"], + [Location of addr2line program]) + + AC_PATH_PROG([IP_PATH], [ip], /sbin/ip, [$LIBVIRT_SBIN_PATH]) + AC_DEFINE_UNQUOTED([IP_PATH], "$IP_PATH", [path to ip binary])
Shouldn't we put /sbin/ip and "$IP_PATH" inside [] here and in the three places below?
+ + AC_PATH_PROG([IPTABLES_PATH], [iptables], /sbin/iptables, [$LIBVIRT_SBIN_PATH]) + AC_DEFINE_UNQUOTED([IPTABLES_PATH], "$IPTABLES_PATH", [path to iptables binary]) + + AC_PATH_PROG([IP6TABLES_PATH], [ip6tables], /sbin/ip6tables, [$LIBVIRT_SBIN_PATH]) + AC_DEFINE_UNQUOTED([IP6TABLES_PATH], "$IP6TABLES_PATH", [path to ip6tables binary]) + + AC_PATH_PROG([EBTABLES_PATH], [ebtables], /sbin/ebtables, [$LIBVIRT_SBIN_PATH]) + AC_DEFINE_UNQUOTED([EBTABLES_PATH], "$EBTABLES_PATH", [path to ebtables binary]) +])
ACK with the suggested changes. Jirka

All checks that prints result at the end of configure uses LIBVIRT_RESULT_${CHECK_NAME}. Create those macros for remaining check. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ++-- m4/virt-host-validate.m4 | 4 ++++ m4/virt-login-shell.m4 | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index af94d18673..3f8e785078 100644 --- a/configure.ac +++ b/configure.ac @@ -2674,8 +2674,8 @@ LIBVIRT_RESULT_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([virt-host-validate: $with_host_validate]) +LIBVIRT_RESULT_LOGIN_SHELL +LIBVIRT_RESULT_HOST_VALIDATE AC_MSG_NOTICE([ TLS priority: $with_tls_priority]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Developer Tools]) diff --git a/m4/virt-host-validate.m4 b/m4/virt-host-validate.m4 index a56fe4154e..8c42303095 100644 --- a/m4/virt-host-validate.m4 +++ b/m4/virt-host-validate.m4 @@ -38,3 +38,7 @@ AC_DEFUN([LIBVIRT_CHECK_HOST_VALIDATE], [ fi AM_CONDITIONAL([WITH_HOST_VALIDATE], [test "x$with_host_validate" = "xyes"]) ]) + +AC_DEFUN([LIBVIRT_RESULT_HOST_VALIDATE], [ + AC_MSG_NOTICE([virt-host-validate: $with_host_validate]) +]) diff --git a/m4/virt-login-shell.m4 b/m4/virt-login-shell.m4 index 55dcaf3646..fb5b488d22 100644 --- a/m4/virt-login-shell.m4 +++ b/m4/virt-login-shell.m4 @@ -1,4 +1,5 @@ dnl Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +dnl Copyright (C) 2016 Red Hat, Inc. 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 @@ -37,3 +38,7 @@ AC_DEFUN([LIBVIRT_CHECK_LOGIN_SHELL], [ fi AM_CONDITIONAL([WITH_LOGIN_SHELL], [test "$with_login_shell" = "yes"]) ]) + +AC_DEFUN([LIBVIRT_RESULT_LOGIN_SHELL], [ + AC_MSG_NOTICE([ virt-login-shell: $with_login_shell]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:32 +0100, Pavel Hrdina wrote:
All checks that prints result at the end of configure uses LIBVIRT_RESULT_${CHECK_NAME}. Create those macros for remaining check.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ++-- m4/virt-host-validate.m4 | 4 ++++ m4/virt-login-shell.m4 | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-)
ACK Jirka

On Fri, Dec 16, 2016 at 21:11:57 +0100, Jiri Denemark wrote:
On Fri, Dec 16, 2016 at 10:10:32 +0100, Pavel Hrdina wrote:
All checks that prints result at the end of configure uses LIBVIRT_RESULT_${CHECK_NAME}. Create those macros for remaining check.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ++-- m4/virt-host-validate.m4 | 4 ++++ m4/virt-login-shell.m4 | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-)
ACK
Actually, my fingers were faster than my brain. Why don't you use LIBVIRT_RESULT rather than AC_MSG_NOTICE. ACK if you change it. Jirka

On Fri, Dec 16, 2016 at 09:14:56PM +0100, Jiri Denemark wrote:
On Fri, Dec 16, 2016 at 21:11:57 +0100, Jiri Denemark wrote:
On Fri, Dec 16, 2016 at 10:10:32 +0100, Pavel Hrdina wrote:
All checks that prints result at the end of configure uses LIBVIRT_RESULT_${CHECK_NAME}. Create those macros for remaining check.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ++-- m4/virt-host-validate.m4 | 4 ++++ m4/virt-login-shell.m4 | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-)
ACK
Actually, my fingers were faster than my brain. Why don't you use LIBVIRT_RESULT rather than AC_MSG_NOTICE.
I'm planning this as a follow up series that will extend LIBVIRT_RESULT. Currently that macro uses only 10 columns for the first part which is not enough for all the "Miscellaneous" and "Test suite" results. Pavel
ACK if you change it.
Jirka
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Mon, Dec 19, 2016 at 10:27:05 +0100, Pavel Hrdina wrote:
On Fri, Dec 16, 2016 at 09:14:56PM +0100, Jiri Denemark wrote:
On Fri, Dec 16, 2016 at 21:11:57 +0100, Jiri Denemark wrote:
On Fri, Dec 16, 2016 at 10:10:32 +0100, Pavel Hrdina wrote:
All checks that prints result at the end of configure uses LIBVIRT_RESULT_${CHECK_NAME}. Create those macros for remaining check.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ++-- m4/virt-host-validate.m4 | 4 ++++ m4/virt-login-shell.m4 | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-)
ACK
Actually, my fingers were faster than my brain. Why don't you use LIBVIRT_RESULT rather than AC_MSG_NOTICE.
I'm planning this as a follow up series that will extend LIBVIRT_RESULT. Currently that macro uses only 10 columns for the first part which is not enough for all the "Miscellaneous" and "Test suite" results.
Fair enough, ACK. Jirka

The LIBVIRT_RESULT does a nice formatting of the output and ensures that the format is unified. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-driver-bhyve.m4 | 2 +- m4/virt-driver-uml.m4 | 2 +- m4/virt-driver-vz.m4 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/m4/virt-driver-bhyve.m4 b/m4/virt-driver-bhyve.m4 index bbdd8b2f0f..11d3a667ee 100644 --- a/m4/virt-driver-bhyve.m4 +++ b/m4/virt-driver-bhyve.m4 @@ -56,5 +56,5 @@ dnl Build with gnulib's getopt which contains a reentrant interface AC_DEFUN([gl_REPLACE_GETOPT_ALWAYS], []) AC_DEFUN([LIBVIRT_DRIVER_RESULT_BHYVE],[ - AC_MSG_NOTICE([ Bhyve: $with_bhyve]) + LIBVIRT_RESULT([Bhyve], [$with_bhyve]) ]) diff --git a/m4/virt-driver-uml.m4 b/m4/virt-driver-uml.m4 index 5c83d76e76..7b252e61ea 100644 --- a/m4/virt-driver-uml.m4 +++ b/m4/virt-driver-uml.m4 @@ -51,5 +51,5 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_UML],[ ]) AC_DEFUN([LIBVIRT_DRIVER_RESULT_UML],[ - AC_MSG_NOTICE([ UML: $with_uml]) + LIBVIRT_RESULT([UML], [$with_uml]) ]) diff --git a/m4/virt-driver-vz.m4 b/m4/virt-driver-vz.m4 index 67001dce50..7b7a8d5a94 100644 --- a/m4/virt-driver-vz.m4 +++ b/m4/virt-driver-vz.m4 @@ -42,5 +42,5 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_VZ],[ ]) AC_DEFUN([LIBVIRT_DRIVER_RESULT_VZ],[ - AC_MSG_NOTICE([ vz: $with_vz]) + LIBVIRT_RESULT([vz], [$with_vz]) ]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:33 +0100, Pavel Hrdina wrote:
The LIBVIRT_RESULT does a nice formatting of the output and ensures that the format is unified.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-driver-bhyve.m4 | 2 +- m4/virt-driver-uml.m4 | 2 +- m4/virt-driver-vz.m4 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/m4/virt-driver-bhyve.m4 b/m4/virt-driver-bhyve.m4 index bbdd8b2f0f..11d3a667ee 100644 --- a/m4/virt-driver-bhyve.m4 +++ b/m4/virt-driver-bhyve.m4 @@ -56,5 +56,5 @@ dnl Build with gnulib's getopt which contains a reentrant interface AC_DEFUN([gl_REPLACE_GETOPT_ALWAYS], [])
AC_DEFUN([LIBVIRT_DRIVER_RESULT_BHYVE],[ - AC_MSG_NOTICE([ Bhyve: $with_bhyve]) + LIBVIRT_RESULT([Bhyve], [$with_bhyve]) ]) ...
Incomplete. Most of the places where AC_MSG_NOTICE is still used after this patch are fixed in later patches, but even after applying all 89 patches, there are still some places where LIBVIRT_RESULT should be used: AC_MSG_NOTICE([ Coverage: $enable_coverage]) AC_MSG_NOTICE([ Alloc OOM: $enable_oom]) AC_MSG_NOTICE([ Use -Werror: $enable_werror]) AC_MSG_NOTICE([ Warning Flags: $WARN_CFLAGS]) AC_MSG_NOTICE([ Char device locks: $with_chrdev_lock_files]) AC_MSG_NOTICE([ Debug: $enable_debug]) AC_MSG_NOTICE([ Default Editor: $with_default_editor]) AC_MSG_NOTICE([ DTrace: $with_dtrace]) AC_MSG_NOTICE([virt-host-validate: $with_host_validate]) AC_MSG_NOTICE([ Init script: $with_init_script]) AC_MSG_NOTICE([ Loader/NVRAM: $with_loader_nvram]) AC_MSG_NOTICE([ virt-login-shell: $with_login_shell]) AC_MSG_NOTICE([ numad: $with_numad]) AC_MSG_NOTICE([ XML Catalog: $with_xml_catalog_file]) Jirka

On Fri, Dec 16, 2016 at 09:23:27PM +0100, Jiri Denemark wrote:
On Fri, Dec 16, 2016 at 10:10:33 +0100, Pavel Hrdina wrote:
The LIBVIRT_RESULT does a nice formatting of the output and ensures that the format is unified.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-driver-bhyve.m4 | 2 +- m4/virt-driver-uml.m4 | 2 +- m4/virt-driver-vz.m4 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/m4/virt-driver-bhyve.m4 b/m4/virt-driver-bhyve.m4 index bbdd8b2f0f..11d3a667ee 100644 --- a/m4/virt-driver-bhyve.m4 +++ b/m4/virt-driver-bhyve.m4 @@ -56,5 +56,5 @@ dnl Build with gnulib's getopt which contains a reentrant interface AC_DEFUN([gl_REPLACE_GETOPT_ALWAYS], [])
AC_DEFUN([LIBVIRT_DRIVER_RESULT_BHYVE],[ - AC_MSG_NOTICE([ Bhyve: $with_bhyve]) + LIBVIRT_RESULT([Bhyve], [$with_bhyve]) ]) ...
Incomplete. Most of the places where AC_MSG_NOTICE is still used after this patch are fixed in later patches, but even after applying all 89 patches, there are still some places where LIBVIRT_RESULT should be used:
AC_MSG_NOTICE([ Coverage: $enable_coverage]) AC_MSG_NOTICE([ Alloc OOM: $enable_oom]) AC_MSG_NOTICE([ Use -Werror: $enable_werror]) AC_MSG_NOTICE([ Warning Flags: $WARN_CFLAGS]) AC_MSG_NOTICE([ Char device locks: $with_chrdev_lock_files]) AC_MSG_NOTICE([ Debug: $enable_debug]) AC_MSG_NOTICE([ Default Editor: $with_default_editor]) AC_MSG_NOTICE([ DTrace: $with_dtrace]) AC_MSG_NOTICE([virt-host-validate: $with_host_validate]) AC_MSG_NOTICE([ Init script: $with_init_script]) AC_MSG_NOTICE([ Loader/NVRAM: $with_loader_nvram]) AC_MSG_NOTICE([ virt-login-shell: $with_login_shell]) AC_MSG_NOTICE([ numad: $with_numad]) AC_MSG_NOTICE([ XML Catalog: $with_xml_catalog_file])
The same applies as for the previous review [1]. The LIBVIRT_RESULT macro needs some tuning before we can use it for those result messages. Pavel [1] <https://www.redhat.com/archives/libvir-list/2016-December/msg00857.html>

On Mon, Dec 19, 2016 at 10:30:54 +0100, Pavel Hrdina wrote:
On Fri, Dec 16, 2016 at 09:23:27PM +0100, Jiri Denemark wrote:
On Fri, Dec 16, 2016 at 10:10:33 +0100, Pavel Hrdina wrote:
The LIBVIRT_RESULT does a nice formatting of the output and ensures that the format is unified.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-driver-bhyve.m4 | 2 +- m4/virt-driver-uml.m4 | 2 +- m4/virt-driver-vz.m4 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) ... The same applies as for the previous review [1]. The LIBVIRT_RESULT macro needs some tuning before we can use it for those result messages.
OK, ACK. JIRKA

Those macros helps to create unified output of "configure --help". Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-lib.m4 | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/m4/virt-lib.m4 b/m4/virt-lib.m4 index a9efb74138..f498af0fc7 100644 --- a/m4/virt-lib.m4 +++ b/m4/virt-lib.m4 @@ -395,3 +395,89 @@ AC_DEFUN([LIBVIRT_RESULT_LIB],[ m4_popdef([check_name]) ]) + +dnl +dnl To be used instead of AC_ARG_WITH +dnl +dnl LIBVIRT_ARG_WITH([CHECK_NAME], [HELP_NAME], [DEFAULT_ACTION], [MIN_VERSION]) +dnl +dnl CHECK_NAME: Suffix/prefix used for variables/flags, in uppercase. +dnl HELP_NAME: Name that will be appear in configure --help +dnl DEFAULT_ACTION: Default configure action +dnl MIN_VERSION: Specify minimal version that will be added to +dnl configure --help (optional) +dnl +dnl LIBVIRT_ARG_WITH([SELINUX], [SeLinux], [check]) +dnl LIBVIRT_ARG_WITH([GLUSTERFS], [glusterfs], [check], [3.4.1]) +dnl +AC_DEFUN([LIBVIRT_ARG_WITH], [ + m4_pushdef([check_name], [$1]) + m4_pushdef([help_name], [[$2]]) + m4_pushdef([default_action], [$3]) + m4_pushdef([min_version], [$4]) + + m4_pushdef([check_name_lc], m4_tolower(check_name)) + m4_pushdef([check_name_dash], m4_translit(check_name_lc, [_], [-])) + + m4_pushdef([arg_var], [with-]check_name_dash) + m4_pushdef([with_var], [with_]check_name_lc) + + m4_pushdef([version_text], m4_ifnblank(min_version, [[ (>= ]]min_version[[)]])) + + m4_divert_text([DEFAULTS], [with_var][[=]][default_action]) + AC_ARG_WITH([check_name_dash], + [AS_HELP_STRING([[--]arg_var], + [with ]]m4_dquote(help_name)m4_dquote(version_text)[[ support @<:@default=]]m4_dquote(default_action)[[@:>@])]) + + m4_popdef([version_text]) + + m4_popdef([with_var]) + m4_popdef([arg_var]) + + m4_popdef([check_name_dash]) + m4_popdef([check_name_lc]) + + m4_popdef([min_version]) + m4_popdef([default_action]) + m4_popdef([help_name]) + m4_popdef([check_name]) +]) + +dnl +dnl To be used instead of AC_ARG_WITH +dnl +dnl LIBVIRT_ARG_WITH_ALT([CHECK_NAME], [HELP_DESC], [DEFAULT_ACTION]) +dnl +dnl CHECK_NAME: Suffix/prefix used for variables/flags, in uppercase. +dnl HELP_DESC: Description that will be appear in configure --help +dnl DEFAULT_ACTION: Default configure action +dnl +dnl LIBVIRT_ARG_WITH([PACKAGER], [Extra packager name], [no]) +dnl LIBVIRT_ARG_WITH([HTML_DIR], [path to base html directory], [$(datadir)/doc]) +dnl +AC_DEFUN([LIBVIRT_ARG_WITH_ALT], [ + m4_pushdef([check_name], [$1]) + m4_pushdef([help_desc], [[$2]]) + m4_pushdef([default_action], [$3]) + + m4_pushdef([check_name_lc], m4_tolower(check_name)) + m4_pushdef([check_name_dash], m4_translit(check_name_lc, [_], [-])) + + m4_pushdef([arg_var], [with-]check_name_dash) + m4_pushdef([with_var], [with_]check_name_lc) + + m4_divert_text([DEFAULTS], [with_var][[=]][default_action]) + AC_ARG_WITH([check_name_dash], + [AS_HELP_STRING([[--]arg_var], + ]m4_dquote(help_desc)[[ @<:@default=]]m4_dquote(default_action)[[@:>@])]) + + m4_popdef([with_var]) + m4_popdef([arg_var]) + + m4_popdef([check_name_dash]) + m4_popdef([check_name_lc]) + + m4_popdef([default_action]) + m4_popdef([help_desc]) + m4_popdef([check_name]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:34 +0100, Pavel Hrdina wrote:
Those macros helps to create unified output of "configure --help".
"These macros help create"...
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-lib.m4 | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+)
diff --git a/m4/virt-lib.m4 b/m4/virt-lib.m4 index a9efb74138..f498af0fc7 100644 --- a/m4/virt-lib.m4 +++ b/m4/virt-lib.m4 @@ -395,3 +395,89 @@ AC_DEFUN([LIBVIRT_RESULT_LIB],[
m4_popdef([check_name]) ]) + +dnl +dnl To be used instead of AC_ARG_WITH +dnl +dnl LIBVIRT_ARG_WITH([CHECK_NAME], [HELP_NAME], [DEFAULT_ACTION], [MIN_VERSION]) +dnl +dnl CHECK_NAME: Suffix/prefix used for variables/flags, in uppercase. +dnl HELP_NAME: Name that will be appear in configure --help
s/will be/will/
+dnl DEFAULT_ACTION: Default configure action +dnl MIN_VERSION: Specify minimal version that will be added to +dnl configure --help (optional) +dnl +dnl LIBVIRT_ARG_WITH([SELINUX], [SeLinux], [check]) +dnl LIBVIRT_ARG_WITH([GLUSTERFS], [glusterfs], [check], [3.4.1]) +dnl +AC_DEFUN([LIBVIRT_ARG_WITH], [ + m4_pushdef([check_name], [$1]) + m4_pushdef([help_name], [[$2]]) + m4_pushdef([default_action], [$3]) + m4_pushdef([min_version], [$4]) + + m4_pushdef([check_name_lc], m4_tolower(check_name)) + m4_pushdef([check_name_dash], m4_translit(check_name_lc, [_], [-])) + + m4_pushdef([arg_var], [with-]check_name_dash) + m4_pushdef([with_var], [with_]check_name_lc) + + m4_pushdef([version_text], m4_ifnblank(min_version, [[ (>= ]]min_version[[)]])) + + m4_divert_text([DEFAULTS], [with_var][[=]][default_action]) + AC_ARG_WITH([check_name_dash], + [AS_HELP_STRING([[--]arg_var], + [with ]]m4_dquote(help_name)m4_dquote(version_text)[[ support @<:@default=]]m4_dquote(default_action)[[@:>@])])
Strange indentation, the "[AS_HELP_STRING" part is a second argument to AC_ARG_WITH() and thus it should be aligned with "[check_name_dash]". The second argument of AS_HELP_STRING() is not aligned with the first one either.
+ + m4_popdef([version_text]) + + m4_popdef([with_var]) + m4_popdef([arg_var]) + + m4_popdef([check_name_dash]) + m4_popdef([check_name_lc]) + + m4_popdef([min_version]) + m4_popdef([default_action]) + m4_popdef([help_name]) + m4_popdef([check_name]) +]) + +dnl +dnl To be used instead of AC_ARG_WITH +dnl +dnl LIBVIRT_ARG_WITH_ALT([CHECK_NAME], [HELP_DESC], [DEFAULT_ACTION]) +dnl +dnl CHECK_NAME: Suffix/prefix used for variables/flags, in uppercase. +dnl HELP_DESC: Description that will be appear in configure --help
s/will be/will/
+dnl DEFAULT_ACTION: Default configure action +dnl +dnl LIBVIRT_ARG_WITH([PACKAGER], [Extra packager name], [no]) +dnl LIBVIRT_ARG_WITH([HTML_DIR], [path to base html directory], [$(datadir)/doc])
s/LIBVIRT_ARG_WITH/LIBVIRT_ARG_WITH_ALT/ in the two lines above
+dnl +AC_DEFUN([LIBVIRT_ARG_WITH_ALT], [ + m4_pushdef([check_name], [$1]) + m4_pushdef([help_desc], [[$2]]) + m4_pushdef([default_action], [$3]) + + m4_pushdef([check_name_lc], m4_tolower(check_name)) + m4_pushdef([check_name_dash], m4_translit(check_name_lc, [_], [-])) + + m4_pushdef([arg_var], [with-]check_name_dash) + m4_pushdef([with_var], [with_]check_name_lc) + + m4_divert_text([DEFAULTS], [with_var][[=]][default_action]) + AC_ARG_WITH([check_name_dash], + [AS_HELP_STRING([[--]arg_var], + ]m4_dquote(help_desc)[[ @<:@default=]]m4_dquote(default_action)[[@:>@])])
Strange indentation again. ACK Jirka

This macro helps to create unified output of "configure --help". Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-lib.m4 | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/m4/virt-lib.m4 b/m4/virt-lib.m4 index f498af0fc7..87c23d4552 100644 --- a/m4/virt-lib.m4 +++ b/m4/virt-lib.m4 @@ -481,3 +481,41 @@ AC_DEFUN([LIBVIRT_ARG_WITH_ALT], [ m4_popdef([help_desc]) m4_popdef([check_name]) ]) + +dnl +dnl To be used instead of AC_ARG_ENABLE +dnl +dnl LIBVIRT_ARG_ENABLE([CHECK_NAME], [HELP_DESC], [DEFAULT_ACTION]) +dnl +dnl CHECK_NAME: Suffix/prefix used for variables/flags, in uppercase. +dnl HELP_DESC: Description that will be appear in configure --help +dnl DEFAULT_ACTION: Default configure action +dnl +dnl LIBVIRT_ARG_ENABLE([DEBUG], [enable debugging output], [yes]) +dnl +AC_DEFUN([LIBVIRT_ARG_ENABLE], [ + m4_pushdef([check_name], [$1]) + m4_pushdef([help_desc], [[$2]]) + m4_pushdef([default_action], [$3]) + + m4_pushdef([check_name_lc], m4_tolower(check_name)) + m4_pushdef([check_name_dash], m4_translit(check_name_lc, [_], [-])) + + m4_pushdef([arg_var], [enable-]check_name_dash) + m4_pushdef([enable_var], [enable_]check_name_lc) + + m4_divert_text([DEFAULTS], [enable_var][[=]][default_action]) + AC_ARG_ENABLE([check_name_dash], + [AS_HELP_STRING([[--]arg_var], + ]m4_dquote(help_desc)[[ @<:@default=]]m4_dquote(default_action)[[@:>@])]) + + m4_popdef([enable_var]) + m4_popdef([arg_var]) + + m4_popdef([check_name_dash]) + m4_popdef([check_name_lc]) + + m4_popdef([default_action]) + m4_popdef([help_desc]) + m4_popdef([check_name]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:35 +0100, Pavel Hrdina wrote:
This macro helps to create unified output of "configure --help".
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-lib.m4 | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
Most of the nits I found in the previous patch apply here as well due to copy&pasta engineering :-) ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 381 ++++++++++++++--------------------------------- m4/virt-apparmor.m4 | 6 +- m4/virt-driver-bhyve.m4 | 5 +- m4/virt-driver-uml.m4 | 5 +- m4/virt-driver-vz.m4 | 5 +- m4/virt-host-validate.m4 | 5 +- m4/virt-init-script.m4 | 8 +- m4/virt-lib.m4 | 21 +-- m4/virt-login-shell.m4 | 5 +- m4/virt-nss.m4 | 7 +- m4/virt-selinux.m4 | 6 +- m4/virt-wireshark.m4 | 7 +- 12 files changed, 134 insertions(+), 327 deletions(-) diff --git a/configure.ac b/configure.ac index 3f8e785078..c4f0623b8c 100644 --- a/configure.ac +++ b/configure.ac @@ -96,14 +96,8 @@ AC_SUBST([LIBVIRT_VERSION]) AC_SUBST([LIBVIRT_VERSION_INFO]) AC_SUBST([LIBVIRT_VERSION_NUMBER]) -AC_ARG_WITH([packager], - [AS_HELP_STRING([--with-packager], - [Extra packager name])], - [],[with_packager=no]) -AC_ARG_WITH([packager-version], - [AS_HELP_STRING([--with-packager-version], - [Extra packager version])], - [],[with_packager_version=no]) +LIBVIRT_ARG_WITH_ALT([PACKAGER], [Extra packager name], [no]) +LIBVIRT_ARG_WITH_ALT([PACKAGER_VERSION], [Extra packager version], [no]) if test "x$with_packager" != "xno" then AC_DEFINE_UNQUOTED([PACKAGER], ["$with_packager"], @@ -416,24 +410,22 @@ LIBVIRT_CHECK_EXTERNAL_PROGRAMS dnl Specific dir for HTML output ? -AC_ARG_WITH([html-dir], [AS_HELP_STRING([--with-html-dir=path], - [path to base html directory, default $datadir/doc/html])], - [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc']) - -AC_ARG_WITH([html-subdir], [AS_HELP_STRING([--with-html-subdir=path], - [directory used under html-dir, default $PACKAGE-$VERSION/html])], - [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"], - [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"]) +LIBVIRT_ARG_WITH_ALT([HTML_DIR], [path to base html directory], + ['$(datadir)/doc']) +LIBVIRT_ARG_WITH_ALT([HTML_SUBDIR], [directory used under html-dir], + ['$(PACKAGE)-$(VERSION)/html']) +if test "x$with_html_subdir" != "x" ; then + HTML_DIR="$with_html_dir/$with_html_subdir" +else + HTML_DIR="$with_html_dir" +fi AC_SUBST([HTML_DIR]) dnl Specific XML catalog file for validation of generated html -AC_ARG_WITH([xml-catalog-file], - [AS_HELP_STRING([--with-xml-catalog-file=path], - [path to XML catalog file for validating - generated html, default /etc/xml/catalog])], - [XML_CATALOG_FILE=$withval], - [XML_CATALOG_FILE='/etc/xml/catalog']) -AC_SUBST([XML_CATALOG_FILE]) +LIBVIRT_ARG_WITH_ALT([XML_CATALOG_FILE], + [path to XML catalog file for validating generated html], + ['/etc/xml/catalog']) +AC_SUBST([XML_CATALOG_FILE], [$with_xml_catalog_file]) dnl if --prefix is /usr, don't use /usr/var for localstatedir dnl or /usr/etc for sysconfdir @@ -447,75 +439,27 @@ if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then fi dnl Allow to build without Xen, QEMU/KVM, test or remote driver -AC_ARG_WITH([xen], - [AS_HELP_STRING([--with-xen], - [add XEN support @<:@default=check@:>@])]) -m4_divert_text([DEFAULTS], [with_xen=check]) -AC_ARG_WITH([xen-inotify], - [AS_HELP_STRING([--with-xen-inotify], - [add XEN inotify support @<:@default=check@:>@])]) -m4_divert_text([DEFAULTS], [with_xen_inotify=check]) -AC_ARG_WITH([qemu], - [AS_HELP_STRING([--with-qemu], - [add QEMU/KVM support @<:@default=yes@:>@])]) -m4_divert_text([DEFAULTS], [with_qemu=yes]) -AC_ARG_WITH([openvz], - [AS_HELP_STRING([--with-openvz], - [add OpenVZ support @<:@default=check@:>@])]) -m4_divert_text([DEFAULTS], [with_openvz=check]) -AC_ARG_WITH([vmware], - [AS_HELP_STRING([--with-vmware], - [add VMware support @<:@default=yes@:>@])]) -m4_divert_text([DEFAULTS], [with_vmware=yes]) -AC_ARG_WITH([phyp], - [AS_HELP_STRING([--with-phyp], - [add PHYP support @<:@default=check@:>@])]) -m4_divert_text([DEFAULTS], [with_phyp=check]) -AC_ARG_WITH([xenapi], - [AS_HELP_STRING([--with-xenapi], - [add XenAPI support @<:@default=check@:>@])]) -m4_divert_text([DEFAULTS], [with_xenapi=check]) -AC_ARG_WITH([libxl], - [AS_HELP_STRING([--with-libxl], - [add libxenlight support @<:@default=check@:>@])]) -m4_divert_text([DEFAULTS], [with_libxl=check]) -AC_ARG_WITH([vbox], - [AS_HELP_STRING([--with-vbox=@<:@PFX@:>@], - [VirtualBox XPCOMC location @<:@default=yes@:>@])]) -m4_divert_text([DEFAULTS], [with_vbox=yes]) -AC_ARG_WITH([lxc], - [AS_HELP_STRING([--with-lxc], - [add Linux Container support @<:@default=check@:>@])]) -m4_divert_text([DEFAULTS], [with_lxc=check]) -AC_ARG_WITH([esx], - [AS_HELP_STRING([--with-esx], - [add ESX support @<:@default=check@:>@])]) -m4_divert_text([DEFAULTS], [with_esx=check]) -AC_ARG_WITH([hyperv], - [AS_HELP_STRING([--with-hyperv], - [add Hyper-V support @<:@default=check@:>@])]) -m4_divert_text([DEFAULTS], [with_hyperv=check]) -AC_ARG_WITH([test], - [AS_HELP_STRING([--with-test], - [add test driver support @<:@default=yes@:>@])]) -m4_divert_text([DEFAULTS], [with_test=yes]) -AC_ARG_WITH([remote], - [AS_HELP_STRING([--with-remote], - [add remote driver support @<:@default=yes@:>@])]) -m4_divert_text([DEFAULTS], [with_remote=yes]) -AC_ARG_WITH([libvirtd], - [AS_HELP_STRING([--with-libvirtd], - [add libvirtd support @<:@default=yes@:>@])]) -m4_divert_text([DEFAULTS], [with_libvirtd=yes]) -AC_ARG_WITH([chrdev-lock-files], - [AS_HELP_STRING([--with-chrdev-lock-files], - [location for UUCP style lock files for character devices - (use auto for default paths on some platforms) @<:@default=auto@:>@])]) -m4_divert_text([DEFAULTS], [with_chrdev_lock_files=auto]) -AC_ARG_WITH([pm-utils], - [AS_HELP_STRING([--with-pm-utils], - [use pm-utils for power management @<:@default=yes@:>@])]) -m4_divert_text([DEFAULTS], [with_pm_utils=check]) +LIBVIRT_ARG_WITH([XEN], [XEN], [check]) +LIBVIRT_ARG_WITH([XEN_INOTIFY], [XEN inotify], [check]) +LIBVIRT_ARG_WITH([QEMU], [QEMU/KVM], [yes]) +LIBVIRT_ARG_WITH([OPENVZ], [OpenVZ], [check]) +LIBVIRT_ARG_WITH([VMWARE], [VMware], [yes]) +LIBVIRT_ARG_WITH([PHYP], [PHYP], [check]) +LIBVIRT_ARG_WITH([XENAPI], [XenAPI], [check]) +LIBVIRT_ARG_WITH([LIBXL], [libxenlight], [check]) +LIBVIRT_ARG_WITH([VBOX], [VirtualBox XPCOMC], [yes]) +LIBVIRT_ARG_WITH([LXC], [Linux Container], [check]) +LIBVIRT_ARG_WITH([ESX], [ESX], [check]) +LIBVIRT_ARG_WITH([HYPERV], [Hyper-V], [check]) +LIBVIRT_ARG_WITH([TEST], [test driver], [yes]) +LIBVIRT_ARG_WITH([REMOTE], [remote driver], [yes]) +LIBVIRT_ARG_WITH([LIBVIRTD], [libvirtd], [yes]) + +LIBVIRT_ARG_WITH_ALT([CHRDEV_LOCK_FILES], + [location for UUCP style lock files for character devices ] + [(use auto for default paths on some platforms)], + [auto]) +LIBVIRT_ARG_WITH_ALT([PM_UTILS], [use pm-utils for power management], [check]) dnl dnl in case someone want to build static binaries @@ -537,10 +481,7 @@ fi LIBVIRT_CHECK_INIT_SCRIPT AC_MSG_CHECKING([for whether to install sysctl config]) -AC_ARG_WITH([sysctl], - [AS_HELP_STRING([--with-sysctl@<:@=yes/no@:>@], - [Whether to install sysctl configs @<:@default=check@:>@])], - [],[with_sysctl=check]) +LIBVIRT_ARG_WITH_ALT([SYSCTL], [Whether to install sysctl configs], [check]) if test "$with_sysctl" = "yes" || test "$with_sysctl" = "check" then @@ -1033,16 +974,16 @@ LIBXML_CFLAGS="" LIBXML_LIBS="" LIBXML_FOUND="no" -AC_ARG_WITH([libxml], [AS_HELP_STRING([--with-libxml=@<:@PFX@:>@], - [libxml2 location])]) +LIBVIRT_ARG_WITH_ALT([LIBXML], [libxml2 (>= 2.6.0) location], [check]) + if test "x$with_libxml" = "xno" ; then AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_REQUIRED) AC_MSG_ERROR([libxml2 >= $LIBXML_REQUIRED is required for libvirt]) -elif test "x$with_libxml" = "x" && test "x$PKG_CONFIG" != "x" ; then +elif test "x$with_libxml" != "xno" && test "x$PKG_CONFIG" != "x" ; then PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED, [LIBXML_FOUND=yes], [LIBXML_FOUND=no]) fi if test "$LIBXML_FOUND" = "no" ; then - if test "x$with_libxml" != "x" ; then + if test "x$with_libxml" != "xyes" ; then LIBXML_CONFIG=$with_libxml/bin/$LIBXML_CONFIG fi AC_MSG_CHECKING(libxml2 $LIBXML_CONFIG >= $LIBXML_REQUIRED ) @@ -1077,11 +1018,9 @@ CFLAGS="$old_CFLAGS" LIBS="$old_LIBS" -AC_ARG_WITH([tls-priority], - [AS_HELP_STRING([--with-tls-priority], - [set the default TLS session priority string @<:@default=NORMAL@:>@])], - [], - [with_tls_priority=NORMAL]) +LIBVIRT_ARG_WITH_ALT([TLS_PRIORITY], + [set the default TLS session priority string], + [NORMAL]) AC_DEFINE_UNQUOTED([TLS_PRIORITY], ["$with_tls_priority"], [TLS default priority string]) @@ -1091,11 +1030,8 @@ dnl PolicyKit library POLKIT_CFLAGS= POLKIT_LIBS= PKCHECK_PATH= -AC_ARG_WITH([polkit], - [AS_HELP_STRING([--with-polkit], - [use PolicyKit for UNIX socket access checks @<:@default=check@:>@])], - [], - [with_polkit=check]) +LIBVIRT_ARG_WITH_ALT([POLKIT], [use PolicyKit for UNIX socket access checks], + [check]) with_polkit0=no with_polkit1=no @@ -1162,11 +1098,8 @@ AC_SUBST([POLKIT_CFLAGS]) AC_SUBST([POLKIT_LIBS]) dnl firewalld -AC_ARG_WITH([firewalld], - [AS_HELP_STRING([--with-firewalld], - [enable firewalld support @<:@default=check@:>@])], - [], - [with_firewalld=check]) +LIBVIRT_ARG_WITH([FIREWALLD], [firewalld], [check]) + if test "x$with_firewalld" = "xcheck" ; then with_firewalld=$with_dbus fi @@ -1202,11 +1135,7 @@ fi AM_CONDITIONAL([VIR_CHRDEV_LOCK_FILE_PATH], [test "$with_chrdev_lock_files" != "no"]) -AC_ARG_WITH([secdriver-selinux], - [AS_HELP_STRING([--with-secdriver-selinux], - [use SELinux security driver @<:@default=check@:>@])], - [], - [with_secdriver_selinux=check]) +LIBVIRT_ARG_WITH_ALT([SECDRIVER_SELINUX], [use SELinux security driver], [check]) if test "$with_selinux" != "yes" ; then if test "$with_secdriver_selinux" = "check" ; then @@ -1242,11 +1171,7 @@ fi AM_CONDITIONAL([WITH_SECDRIVER_SELINUX], [test "$with_secdriver_selinux" != "no"]) -AC_ARG_WITH([secdriver-apparmor], - [AS_HELP_STRING([--with-secdriver-apparmor], - [use AppArmor security driver @<:@default=check@:>@])], - [], - [with_secdriver_apparmor=check]) +LIBVIRT_ARG_WITH_ALT([SECDRIVER_APPARMOR], [use AppArmor security driver], [check]) if test "$with_apparmor" != "yes" ; then if test "$with_secdriver_apparmor" = "check" ; then @@ -1261,22 +1186,14 @@ elif test "with_secdriver_apparmor" != "no" ; then fi AM_CONDITIONAL([WITH_SECDRIVER_APPARMOR], [test "$with_secdriver_apparmor" != "no"]) -AC_ARG_WITH([apparmor-profiles], - [AS_HELP_STRING([--with-apparmor-profiles], - [install apparmor profiles @<:@default=no@:>@])], - [with_apparmor_profiles=yes], - [with_apparmor_profiles=no]) +LIBVIRT_ARG_WITH_ALT([APPARMOR_PROFILES], [install apparmor profiles], [no]) if test "$with_apparmor" = "no"; then with_apparmor_profiles="no" fi AM_CONDITIONAL([WITH_APPARMOR_PROFILES], [test "$with_apparmor_profiles" != "no"]) dnl DTrace static probes -AC_ARG_WITH([dtrace], - [AS_HELP_STRING([--with-dtrace], - [use dtrace for static probing @<:@default=check@:>@])], - [], - [with_dtrace=check]) +LIBVIRT_ARG_WITH_ALT([DTRACE], [use dtrace for static probing], [check]) if test "$with_dtrace" != "no" ; then AC_PATH_PROG([DTRACE], [dtrace], [], [$LIBVIRT_SBIN_PATH]) @@ -1297,11 +1214,7 @@ AM_CONDITIONAL([WITH_DTRACE_PROBES], [test "$with_dtrace" != "no"]) dnl numad -AC_ARG_WITH([numad], - [AS_HELP_STRING([--with-numad], - [use numad to manage CPU placement dynamically @<:@default=check@:>@])], - [], - [with_numad=check]) +LIBVIRT_ARG_WITH_ALT([NUMAD], [use numad to manage CPU placement dynamically], [check]) if test "$with_numad" != "no" ; then fail=0 @@ -1336,12 +1249,11 @@ LIBPCAP_CFLAGS="" LIBPCAP_LIBS="" LIBPCAP_FOUND="no" -AC_ARG_WITH([libpcap], [AS_HELP_STRING([--with-libpcap=@<:@PFX@:>@], - [libpcap location])]) +LIBVIRT_ARG_WITH_ALT([LIBPCAP], [libpcap location], [check]) if test "$with_qemu" = "yes"; then case $with_libpcap in no) LIBPCAP_CONFIG= ;; - ''|yes) LIBPCAP_CONFIG="pcap-config" ;; + ''|yes|check) LIBPCAP_CONFIG="pcap-config" ;; *) LIBPCAP_CONFIG="$with_libpcap/bin/pcap-config" ;; esac AS_IF([test "x$LIBPCAP_CONFIG" != "x"], [ @@ -1413,10 +1325,7 @@ AM_CONDITIONAL([WITH_PM_UTILS], [test "$with_pm_utils" = "yes"]) dnl check if the network driver should be compiled -AC_ARG_WITH([network], - [AS_HELP_STRING([--with-network], - [with virtual network driver @<:@default=yes@:>@])], - [],[with_network=yes]) +LIBVIRT_ARG_WITH_ALT([NETWORK], [with virtual network driver], [yes]) dnl there's no use compiling the network driver without the libvirt dnl daemon, nor compiling it for MacOS X, where it breaks the compile @@ -1438,10 +1347,7 @@ fi AM_CONDITIONAL([WITH_BRIDGE], [test "$with_bridge" = "yes"]) -AC_ARG_WITH([secrets], - [AS_HELP_STRING([--with-secrets], - [with local secrets management driver @<:@default=yes@:>@])], - [],[with_secrets=yes]) +LIBVIRT_ARG_WITH([SECRETS], [local secrets management driver], [yes]) if test "$with_libvirtd" = "no"; then with_secrets=no @@ -1452,51 +1358,17 @@ fi AM_CONDITIONAL([WITH_SECRETS], [test "$with_secrets" = "yes"]) -AC_ARG_WITH([storage-dir], - [AS_HELP_STRING([--with-storage-dir], - [with directory backend for the storage driver @<:@default=yes@:>@])], - [],[with_storage_dir=yes]) -AC_ARG_WITH([storage-fs], - [AS_HELP_STRING([--with-storage-fs], - [with FileSystem backend for the storage driver @<:@default=check@:>@])], - [],[with_storage_fs=check]) -AC_ARG_WITH([storage-lvm], - [AS_HELP_STRING([--with-storage-lvm], - [with LVM backend for the storage driver @<:@default=check@:>@])], - [],[with_storage_lvm=check]) -AC_ARG_WITH([storage-iscsi], - [AS_HELP_STRING([--with-storage-iscsi], - [with iSCSI backend for the storage driver @<:@default=check@:>@])], - [],[with_storage_iscsi=check]) -AC_ARG_WITH([storage-scsi], - [AS_HELP_STRING([--with-storage-scsi], - [with SCSI backend for the storage driver @<:@default=check@:>@])], - [],[with_storage_scsi=check]) -AC_ARG_WITH([storage-mpath], - [AS_HELP_STRING([--with-storage-mpath], - [with mpath backend for the storage driver @<:@default=check@:>@])], - [],[with_storage_mpath=check]) -AC_ARG_WITH([storage-disk], - [AS_HELP_STRING([--with-storage-disk], - [with GPartd Disk backend for the storage driver @<:@default=check@:>@])], - [],[with_storage_disk=check]) -AC_ARG_WITH([storage-rbd], - [AS_HELP_STRING([--with-storage-rbd], - [with RADOS Block Device backend for the storage driver - @<:@default=check@:>@])], - [],[with_storage_rbd=check]) -AC_ARG_WITH([storage-sheepdog], - [AS_HELP_STRING([--with-storage-sheepdog], - [with Sheepdog backend for the storage driver @<:@default=check@:>@])], - [],[with_storage_sheepdog=check]) -AC_ARG_WITH([storage-gluster], - [AS_HELP_STRING([--with-storage-gluster], - [with Gluster backend for the storage driver @<:@default=check@:>@])], - [],[with_storage_gluster=check]) -AC_ARG_WITH([storage-zfs], - [AS_HELP_STRING([--with-storage-zfs], - [with ZFS backend for the storage driver @<:@default=check@:>@])], - [],[with_storage_zfs=check]) +LIBVIRT_ARG_WITH([STORAGE_DIR], [directory backend for the storage driver], [yes]) +LIBVIRT_ARG_WITH([STORAGE_FS], [FileSystem backend for the storage driver], [check]) +LIBVIRT_ARG_WITH([STORAGE_LVM], [LVM backend for storage driver], [check]) +LIBVIRT_ARG_WITH([STORAGE_ISCSI], [iSCSI backend for the storage driver], [check]) +LIBVIRT_ARG_WITH([STORAGE_SCSI], [SCSI backend for the storage driver], [check]) +LIBVIRT_ARG_WITH([STORAGE_MPATH], [mpath backend for the storage driver], [check]) +LIBVIRT_ARG_WITH([STORAGE_DISK], [GPartd Disk backend for the storage driver], [check]) +LIBVIRT_ARG_WITH([STORAGE_RBD], [RADOS Block Device backend for the storage driver], [check]) +LIBVIRT_ARG_WITH([STORAGE_SHEEPDOG], [with Sheepdog backend for the storage driver], [check]) +LIBVIRT_ARG_WITH([STORAGE_GLUSTER], [Gluster backend for the storage driver], [check]) +LIBVIRT_ARG_WITH([STORAGE_ZFS], [ZFS backend for the storage driver], [check]) if test "$with_libvirtd" = "no"; then with_storage_dir=no @@ -1917,25 +1789,22 @@ if test -z "$PERL"; then AC_MSG_ERROR([Failed to find perl.]) fi -AC_ARG_WITH([test-suite], - [AS_HELP_STRING([--with-test-suite], - [build test suite by default @<:@default=check@:>@])], - [case "${withval}" in - yes|no|check) ;; - *) AC_MSG_ERROR([bad value ${withval} for tests option]) ;; - esac], - [withval=check]) +LIBVIRT_ARG_WITH_ALT([TEST_SUITE], [build test suite by default], [check]) +case "$with_test_suite" in + yes|no|check) ;; + *) AC_MSG_ERROR([bad value ${withval} for tests option]) ;; +esac AC_MSG_CHECKING([Whether to build test suite by default]) -if test "$withval" = "check" ; then +if test "$with_test_suite" = "check" ; then if test -d $srcdir/.git ; then - withval=yes + with_test_suite=yes else - withval=no + with_test_suite=no fi fi -AC_MSG_RESULT([$withval]) -AM_CONDITIONAL([WITH_TESTS], [test "$withval" = "yes"]) +AC_MSG_RESULT([$with_test_suite]) +AM_CONDITIONAL([WITH_TESTS], [test "$with_test_suite" = "yes"]) AC_ARG_ENABLE([expensive-tests], [AS_HELP_STRING([--enable-expensive-tests], @@ -2121,11 +1990,8 @@ AM_CONDITIONAL([WITH_WIN_ICON], [test "$WINDRES" != ""]) dnl Driver-Modules library -AC_ARG_WITH([driver-modules], - [AS_HELP_STRING([--with-driver-modules], - [build drivers as loadable modules @<:@default=check@:>@])], - [], - [with_driver_modules=check]) +LIBVIRT_ARG_WITH_ALT([DRIVER_MODULES], [build drivers as loadable modules], + [check]) if test "$with_libvirtd" = "no" ; then with_driver_modules=no @@ -2187,10 +2053,7 @@ fi AM_CONDITIONAL([WITH_NWFILTER], [test "$with_nwfilter" = "yes"]) dnl check if the interface driver should be compiled -AC_ARG_WITH([interface], - [AS_HELP_STRING([--with-interface], - [with host interface driver @<:@default=check@:>@])], - [],[with_interface=check]) +LIBVIRT_ARG_WITH([INTERFACE], [host interface driver], [check]) dnl Don't compile the interface driver without libvirtd if test "$with_libvirtd" = "no" ; then @@ -2219,18 +2082,20 @@ else default_qemu_group=root fi -AC_ARG_WITH([qemu-user], - [AS_HELP_STRING([--with-qemu-user], - [username to run QEMU system instance as - @<:@default=platform dependent@:>@])], - [QEMU_USER=${withval}], - [QEMU_USER=${default_qemu_user}]) -AC_ARG_WITH([qemu-group], - [AS_HELP_STRING([--with-qemu-group], - [groupname to run QEMU system instance as - @<:@default=platform dependent@:>@])], - [QEMU_GROUP=${withval}], - [QEMU_GROUP=${default_qemu_group}]) +LIBVIRT_ARG_WITH_ALT([QEMU_USER], [username to run QEMU system instance as], + ['platform dependent']) +LIBVIRT_ARG_WITH_ALT([QEMU_GROUP], [groupname to run QEMU system instance as], + ['platform dependent']) +if test "x$with_qemu_user" = "xplatform dependent" ; then + QEMU_USER="$default_qemu_user" +else + QEMU_USER="$with_qemu_user" +fi +if test "x$with_qemu_group" = "xplatform dependent" ; then + QEMU_GROUP="$default_qemu_group" +else + QEMU_GROUP="$with_qemu_group" +fi AC_DEFINE_UNQUOTED([QEMU_USER], ["$QEMU_USER"], [QEMU user account]) AC_DEFINE_UNQUOTED([QEMU_GROUP], ["$QEMU_GROUP"], [QEMU group account]) @@ -2238,11 +2103,7 @@ AC_PATH_PROG([QEMU_BRIDGE_HELPER], [qemu-bridge-helper], [/usr/libexec/qemu-brid [/usr/libexec:/usr/lib/qemu:/usr/lib]) AC_DEFINE_UNQUOTED([QEMU_BRIDGE_HELPER], ["$QEMU_BRIDGE_HELPER"], [QEMU bridge helper]) -AC_ARG_WITH([macvtap], - [AS_HELP_STRING([--with-macvtap], - [enable macvtap device @<:@default=check@:>@])], - [with_macvtap=${withval}], - [with_macvtap=check]) +LIBVIRT_ARG_WITH_ALT([MACVTAP], [enable macvtap device], [check]) AC_MSG_CHECKING([whether to compile with macvtap support]) if test "$with_macvtap" != "no" ; then @@ -2272,11 +2133,7 @@ if test "$with_macvtap" = yes; then fi -AC_ARG_WITH([virtualport], - [AS_HELP_STRING([--with-virtualport], - [enable virtual port support @<:@default=check@:>@])], - [with_virtualport=${withval}], - [with_virtualport=check]) +LIBVIRT_ARG_WITH_ALT([VIRTUALPORT], [enable virtual port support], [check]) dnl Warn the user and error out if they requested virtualport support with configure dnl options, but the required macvtap support isn't available @@ -2467,30 +2324,22 @@ test "x$lv_cv_static_analysis" = xyes && t=1 AC_DEFINE_UNQUOTED([STATIC_ANALYSIS], [$t], [Define to 1 when performing static analysis.]) -AC_ARG_WITH([default-editor], - [AS_HELP_STRING([--with-default-editor], - [Editor to use for interactive commands - @<:@default=vi@:>@])], - [DEFAULT_EDITOR=${withval}], - [DEFAULT_EDITOR=vi]) -AC_DEFINE_UNQUOTED([DEFAULT_EDITOR], ["$DEFAULT_EDITOR"], [Default editor to use]) - -AC_ARG_WITH([loader-nvram], - [AS_HELP_STRING([--with-loader-nvram], - [Pass list of pairs of <loader>:<nvram> paths. Both - pairs and list items are separated by a colon. - @<:default=paths to OVMF and its clones@:>@])], - [if test "$withval" = "no"; then - withval="" - else - l=`echo $withval | tr ':' '\n' | wc -l` - if test "`expr $l % 2`" -ne 0; then - AC_MSG_ERROR([Malformed --with-loader-nvram argument]) - fi - fi - AC_DEFINE_UNQUOTED([DEFAULT_LOADER_NVRAM], - ["$withval"], - [List of loader:nvram pairs])]) +LIBVIRT_ARG_WITH_ALT([DEFAULT_EDITOR], [Editor to use for interactive commands], [vi]) +AC_DEFINE_UNQUOTED([DEFAULT_EDITOR], ["$with_default_editor"], [Default editor to use]) + +LIBVIRT_ARG_WITH_ALT([LOADER_NVRAM], + [Pass list of pairs of <loader>:<nvram> paths. + Both pairs and list items are separated by a colon.], + ['']) +if test "x$with_loader_nvram" != "xno" && \ + test "x$with_loader_nvram" != "x" ; then + l=$(echo $with_loader_nvram | tr ':' '\n' | wc -l) + if test $(expr $l % 2) -ne 0 ; then + AC_MSG_ERROR([Malformed --with-loader-nvram argument]) + fi + AC_DEFINE_UNQUOTED([DEFAULT_LOADER_NVRAM], [$with_loader_nvram], + [List of loader:nvram pairs]) +fi # Some GNULIB base64 symbols clash with a kerberos library AC_DEFINE_UNQUOTED([isbase64],[libvirt_gl_isbase64],[Hack to avoid symbol clash]) @@ -2669,10 +2518,10 @@ AC_MSG_NOTICE([ Use -Werror: $set_werror]) AC_MSG_NOTICE([ Warning Flags: $WARN_CFLAGS]) AC_MSG_NOTICE([ DTrace: $with_dtrace]) AC_MSG_NOTICE([ numad: $with_numad]) -AC_MSG_NOTICE([ XML Catalog: $XML_CATALOG_FILE]) +AC_MSG_NOTICE([ XML Catalog: $with_xml_catalog_file]) LIBVIRT_RESULT_INIT_SCRIPT AC_MSG_NOTICE([ Char device locks: $with_chrdev_lock_files]) -AC_MSG_NOTICE([ Default Editor: $DEFAULT_EDITOR]) +AC_MSG_NOTICE([ Default Editor: $with_default_editor]) AC_MSG_NOTICE([ Loader/NVRAM: $with_loader_nvram]) LIBVIRT_RESULT_LOGIN_SHELL LIBVIRT_RESULT_HOST_VALIDATE diff --git a/m4/virt-apparmor.m4 b/m4/virt-apparmor.m4 index 3b7fc37aa7..eb017d181b 100644 --- a/m4/virt-apparmor.m4 +++ b/m4/virt-apparmor.m4 @@ -21,11 +21,7 @@ AC_DEFUN([LIBVIRT_CHECK_APPARMOR],[ LIBVIRT_CHECK_LIB([APPARMOR], [apparmor], [aa_change_profile], [sys/apparmor.h]) - AC_ARG_WITH([apparmor_mount], - [AS_HELP_STRING([--with-apparmor-mount], - [set AppArmor mount point @<:@default=check@:>@])], - [], - [with_apparmor_mount=check]) + LIBVIRT_ARG_WITH_ALT([APPARMOR_MOUNT], [set AppArmor mount point], [check]) if test "$with_apparmor" = "yes"; then AC_DEFINE_UNQUOTED([APPARMOR_DIR], diff --git a/m4/virt-driver-bhyve.m4 b/m4/virt-driver-bhyve.m4 index 11d3a667ee..c83eff08e9 100644 --- a/m4/virt-driver-bhyve.m4 +++ b/m4/virt-driver-bhyve.m4 @@ -18,10 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_DRIVER_CHECK_BHYVE],[ - AC_ARG_WITH([bhyve], - [AS_HELP_STRING([--with-bhyve], - [add BHyVe support @<:@default=check@:>@])]) - m4_divert_text([DEFAULTS], [with_bhyve=check]) + LIBVIRT_ARG_WITH([BHYVE], [BHyVe], [check]) if test "$with_bhyve" != "no"; then AC_PATH_PROG([BHYVE], [bhyve], [], [$PATH:/usr/sbin]) diff --git a/m4/virt-driver-uml.m4 b/m4/virt-driver-uml.m4 index 7b252e61ea..bc3f7d5a45 100644 --- a/m4/virt-driver-uml.m4 +++ b/m4/virt-driver-uml.m4 @@ -18,10 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_DRIVER_CHECK_UML],[ - AC_ARG_WITH([uml], - [AS_HELP_STRING([--with-uml], - [add UML support @<:@default=check@:>@])]) - m4_divert_text([DEFAULTS], [with_uml=check]) + LIBVIRT_ARG_WITH([UML], [UML], [check]) if test "$with_libvirtd" = "no" || test "$with_linux" = "no"; then if test "$with_uml" = "yes"; then diff --git a/m4/virt-driver-vz.m4 b/m4/virt-driver-vz.m4 index 7b7a8d5a94..a51857467e 100644 --- a/m4/virt-driver-vz.m4 +++ b/m4/virt-driver-vz.m4 @@ -18,10 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_DRIVER_CHECK_VZ],[ - AC_ARG_WITH([vz], - [AS_HELP_STRING([--with-vz], - [add Virtuozzo support @<:@default=check@:>@])]) - m4_divert_text([DEFAULTS], [with_vz=check]) + LIBVIRT_ARG_WITH([VZ], [Virtuozzo], [check]) if test "$with_vz" = "yes" || test "$with_vz" = "check"; then diff --git a/m4/virt-host-validate.m4 b/m4/virt-host-validate.m4 index 8c42303095..3aca34deee 100644 --- a/m4/virt-host-validate.m4 +++ b/m4/virt-host-validate.m4 @@ -16,10 +16,7 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. AC_DEFUN([LIBVIRT_CHECK_HOST_VALIDATE], [ - AC_ARG_WITH([host_validate], - [AS_HELP_STRING([--with-host-validate], - [build virt-host-validate @<:@default=check@:>@])]) - m4_divert_text([DEFAULTS], [with_host_validate=check]) + LIBVIRT_ARG_WITH_ALT([HOST_VALIDATE], [build virt-host-validate], [check]) if test "x$with_host_validate" != "xno"; then if test "x$with_win" = "xyes"; then diff --git a/m4/virt-init-script.m4 b/m4/virt-init-script.m4 index c307b0e9b2..1eb43a9288 100644 --- a/m4/virt-init-script.m4 +++ b/m4/virt-init-script.m4 @@ -18,11 +18,9 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_INIT_SCRIPT],[ - AC_ARG_WITH([init-script], - [AS_HELP_STRING([--with-init-script@<:@=STYLE@:>@], - [Style of init script to install: redhat, systemd, systemd+redhat, - upstart, check, none @<:@default=check@:>@])], - [],[with_init_script=check]) + LIBVIRT_ARG_WITH_ALT([INIT_SCRIPT], + [Style of init script to install: redhat, systemd, + systemd+redhat, upstart, check, none], [check]) AC_MSG_CHECKING([for init script type]) diff --git a/m4/virt-lib.m4 b/m4/virt-lib.m4 index 87c23d4552..473d184880 100644 --- a/m4/virt-lib.m4 +++ b/m4/virt-lib.m4 @@ -60,13 +60,9 @@ AC_DEFUN([LIBVIRT_CHECK_LIB],[ m4_pushdef([make_var], [WITH_]check_name) m4_pushdef([cflags_var], check_name[_CFLAGS]) m4_pushdef([libs_var], check_name[_LIBS]) - m4_pushdef([arg_var], [with-]check_name_dash) m4_pushdef([with_var], [with_]check_name_lc) - m4_divert_text([DEFAULTS], [with_var][=check]) - AC_ARG_WITH(check_name_dash, - [AS_HELP_STRING([--arg_var], - [with lib]]m4_dquote(library_name)[[ support @<:@default=check@:>@])]) + LIBVIRT_ARG_WITH(check_name, library_name, [check]) old_LIBS=$LIBS old_CFLAGS=$CFLAGS @@ -121,7 +117,6 @@ AC_DEFUN([LIBVIRT_CHECK_LIB],[ fi m4_popdef([with_var]) - m4_popdef([arg_var]) m4_popdef([libs_var]) m4_popdef([cflags_var]) m4_popdef([make_var]) @@ -190,15 +185,11 @@ AC_DEFUN([LIBVIRT_CHECK_LIB_ALT],[ m4_pushdef([make_var], [WITH_]check_name) m4_pushdef([cflags_var], check_name[_CFLAGS]) m4_pushdef([libs_var], check_name[_LIBS]) - m4_pushdef([arg_var], [with-]check_name_dash) m4_pushdef([with_var], [with_]check_name_lc) m4_pushdef([config_var_alt], [WITH_]check_name_alt) m4_pushdef([make_var_alt], [WITH_]check_name_alt) - m4_divert_text([DEFAULTS], [with_var][=check]) - AC_ARG_WITH(check_name_dash, - [AS_HELP_STRING([--arg_var], - [with lib]]m4_dquote(library_name)[[ support @<:@default=check@:>@])]) + LIBVIRT_ARG_WITH(check_name, library_name, [check]) old_LIBS=$LIBS old_CFLAGS=$CFLAGS @@ -269,7 +260,6 @@ AC_DEFUN([LIBVIRT_CHECK_LIB_ALT],[ m4_popdef([make_var_alt]) m4_popdef([config_var_alt]) m4_popdef([with_var]) - m4_popdef([arg_var]) m4_popdef([libs_var]) m4_popdef([cflags_var]) m4_popdef([make_var]) @@ -320,13 +310,9 @@ AC_DEFUN([LIBVIRT_CHECK_PKG],[ m4_pushdef([make_var], [WITH_]check_name) m4_pushdef([cflags_var], check_name[_CFLAGS]) m4_pushdef([libs_var], check_name[_LIBS]) - m4_pushdef([arg_var], [with-]check_name_dash) m4_pushdef([with_var], [with_]check_name_lc) - m4_divert_text([DEFAULTS], [with_var][=check]) - AC_ARG_WITH(check_name_dash, - [AS_HELP_STRING([--arg_var], - [with ]]m4_dquote(pc_name)[[ (>= ]]m4_dquote(pc_version)[[) support @<:@default=check@:>@])]) + LIBVIRT_ARG_WITH(check_name, pc_name, [check], pc_version) fail=0 if test "x$with_var" != "xno" ; then @@ -351,7 +337,6 @@ AC_DEFUN([LIBVIRT_CHECK_PKG],[ AM_CONDITIONAL(make_var, [test "x$with_var" = "xyes"]) m4_popdef([with_var]) - m4_popdef([arg_var]) m4_popdef([libs_var]) m4_popdef([cflags_var]) m4_popdef([make_var]) diff --git a/m4/virt-login-shell.m4 b/m4/virt-login-shell.m4 index fb5b488d22..a2b90dae6e 100644 --- a/m4/virt-login-shell.m4 +++ b/m4/virt-login-shell.m4 @@ -16,10 +16,7 @@ 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=check@:>@])]) - m4_divert_text([DEFAULTS], [with_login_shell=check]) + LIBVIRT_ARG_WITH_ALT([LOGIN_SHELL], [build virt-login-shell], [check]) if test "x$with_login_shell" != "xno"; then if test "x$with_linux" != "xyes"; then diff --git a/m4/virt-nss.m4 b/m4/virt-nss.m4 index bf5c416c31..f95010d692 100644 --- a/m4/virt-nss.m4 +++ b/m4/virt-nss.m4 @@ -18,10 +18,9 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_NSS],[ - AC_ARG_WITH([nss-plugin], - [AS_HELP_STRING([--with-nss-plugin], - [enable Name Service Switch plugin for resolving guest IP addresses])], - [], [with_nss_plugin=check]) + LIBVIRT_ARG_WITH_ALT([NSS_PLUGIN], + [enable Name Service Switch plugin for resolving guest + IP addresses], [check]) bsd_nss=no fail=0 diff --git a/m4/virt-selinux.m4 b/m4/virt-selinux.m4 index a65e978465..afc4772c2d 100644 --- a/m4/virt-selinux.m4 +++ b/m4/virt-selinux.m4 @@ -21,11 +21,7 @@ AC_DEFUN([LIBVIRT_CHECK_SELINUX],[ LIBVIRT_CHECK_LIB([SELINUX], [selinux], [fgetfilecon_raw], [selinux/selinux.h]) - AC_ARG_WITH([selinux_mount], - [AS_HELP_STRING([--with-selinux-mount], - [set SELinux mount point @<:@default=check@:>@])], - [], - [with_selinux_mount=check]) + LIBVIRT_ARG_WITH_ALT([SELINUX_MOUNT], [set SELinux mount point], [check]) if test "$with_selinux" = "yes"; then # libselinux changed signatures between 2.2 and 2.3 diff --git a/m4/virt-wireshark.m4 b/m4/virt-wireshark.m4 index d5d7404382..89976ba3f9 100644 --- a/m4/virt-wireshark.m4 +++ b/m4/virt-wireshark.m4 @@ -20,10 +20,9 @@ dnl AC_DEFUN([LIBVIRT_CHECK_WIRESHARK],[ LIBVIRT_CHECK_PKG([WIRESHARK_DISSECTOR], [wireshark], [1.11.3]) - AC_ARG_WITH([ws-plugindir], - [AS_HELP_STRING([--with-ws-plugindir], - [wireshark plugins directory for use when installing wireshark plugin])], - [], [with_ws_plugindir=check]) + LIBVIRT_ARG_WITH_ALT([WS_PLUGINDIR], + [wireshark plugins directory for use when installing + wireshark plugin], [check]) dnl Check for system location of wireshark plugins if test "x$with_wireshark_dissector" != "xno" ; then -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:36 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 381 ++++++++++++++--------------------------------- m4/virt-apparmor.m4 | 6 +- m4/virt-driver-bhyve.m4 | 5 +- m4/virt-driver-uml.m4 | 5 +- m4/virt-driver-vz.m4 | 5 +- m4/virt-host-validate.m4 | 5 +- m4/virt-init-script.m4 | 8 +- m4/virt-lib.m4 | 21 +-- m4/virt-login-shell.m4 | 5 +- m4/virt-nss.m4 | 7 +- m4/virt-selinux.m4 | 6 +- m4/virt-wireshark.m4 | 7 +- 12 files changed, 134 insertions(+), 327 deletions(-)
diff --git a/configure.ac b/configure.ac index 3f8e785078..c4f0623b8c 100644 --- a/configure.ac +++ b/configure.ac ... @@ -1033,16 +974,16 @@ LIBXML_CFLAGS="" LIBXML_LIBS="" LIBXML_FOUND="no"
-AC_ARG_WITH([libxml], [AS_HELP_STRING([--with-libxml=@<:@PFX@:>@], - [libxml2 location])]) +LIBVIRT_ARG_WITH_ALT([LIBXML], [libxml2 (>= 2.6.0) location], [check]) + if test "x$with_libxml" = "xno" ; then AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_REQUIRED) AC_MSG_ERROR([libxml2 >= $LIBXML_REQUIRED is required for libvirt]) -elif test "x$with_libxml" = "x" && test "x$PKG_CONFIG" != "x" ; then +elif test "x$with_libxml" != "xno" && test "x$PKG_CONFIG" != "x" ; then PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED, [LIBXML_FOUND=yes], [LIBXML_FOUND=no]) fi if test "$LIBXML_FOUND" = "no" ; then - if test "x$with_libxml" != "x" ; then + if test "x$with_libxml" != "xyes" ; then LIBXML_CONFIG=$with_libxml/bin/$LIBXML_CONFIG fi AC_MSG_CHECKING(libxml2 $LIBXML_CONFIG >= $LIBXML_REQUIRED )
This hunk doesn't seem to be correct. First, "x$with_libxml" != "xno" is always true in the else branch of "x$with_libxml" = "xno". But more importantly, you would remove the option to override the path to libxml using --with-libxml=/path/to/libxml in case another libxml library is installed. ...
@@ -2219,18 +2082,20 @@ else default_qemu_group=root fi
-AC_ARG_WITH([qemu-user], - [AS_HELP_STRING([--with-qemu-user], - [username to run QEMU system instance as - @<:@default=platform dependent@:>@])], - [QEMU_USER=${withval}], - [QEMU_USER=${default_qemu_user}]) -AC_ARG_WITH([qemu-group], - [AS_HELP_STRING([--with-qemu-group], - [groupname to run QEMU system instance as - @<:@default=platform dependent@:>@])], - [QEMU_GROUP=${withval}], - [QEMU_GROUP=${default_qemu_group}]) +LIBVIRT_ARG_WITH_ALT([QEMU_USER], [username to run QEMU system instance as], + ['platform dependent'])
Any reason why $default_qemu_user is not used as the default value rather than 'platform dependent'?
+LIBVIRT_ARG_WITH_ALT([QEMU_GROUP], [groupname to run QEMU system instance as], + ['platform dependent'])
And similarly here for $default_qemu_group.
+if test "x$with_qemu_user" = "xplatform dependent" ; then + QEMU_USER="$default_qemu_user" +else + QEMU_USER="$with_qemu_user" +fi +if test "x$with_qemu_group" = "xplatform dependent" ; then + QEMU_GROUP="$default_qemu_group" +else + QEMU_GROUP="$with_qemu_group" +fi AC_DEFINE_UNQUOTED([QEMU_USER], ["$QEMU_USER"], [QEMU user account]) AC_DEFINE_UNQUOTED([QEMU_GROUP], ["$QEMU_GROUP"], [QEMU group account])
...
@@ -2467,30 +2324,22 @@ test "x$lv_cv_static_analysis" = xyes && t=1 AC_DEFINE_UNQUOTED([STATIC_ANALYSIS], [$t], [Define to 1 when performing static analysis.])
-AC_ARG_WITH([default-editor], - [AS_HELP_STRING([--with-default-editor], - [Editor to use for interactive commands - @<:@default=vi@:>@])], - [DEFAULT_EDITOR=${withval}], - [DEFAULT_EDITOR=vi]) -AC_DEFINE_UNQUOTED([DEFAULT_EDITOR], ["$DEFAULT_EDITOR"], [Default editor to use]) - -AC_ARG_WITH([loader-nvram], - [AS_HELP_STRING([--with-loader-nvram], - [Pass list of pairs of <loader>:<nvram> paths. Both - pairs and list items are separated by a colon. - @<:default=paths to OVMF and its clones@:>@])], - [if test "$withval" = "no"; then - withval="" - else - l=`echo $withval | tr ':' '\n' | wc -l` - if test "`expr $l % 2`" -ne 0; then - AC_MSG_ERROR([Malformed --with-loader-nvram argument]) - fi - fi - AC_DEFINE_UNQUOTED([DEFAULT_LOADER_NVRAM], - ["$withval"], - [List of loader:nvram pairs])]) +LIBVIRT_ARG_WITH_ALT([DEFAULT_EDITOR], [Editor to use for interactive commands], [vi]) +AC_DEFINE_UNQUOTED([DEFAULT_EDITOR], ["$with_default_editor"], [Default editor to use]) + +LIBVIRT_ARG_WITH_ALT([LOADER_NVRAM], + [Pass list of pairs of <loader>:<nvram> paths. + Both pairs and list items are separated by a colon.], + ['']) +if test "x$with_loader_nvram" != "xno" && \ + test "x$with_loader_nvram" != "x" ; then + l=$(echo $with_loader_nvram | tr ':' '\n' | wc -l) + if test $(expr $l % 2) -ne 0 ; then
I believe `...` is more portable than $(...)
+ AC_MSG_ERROR([Malformed --with-loader-nvram argument]) + fi + AC_DEFINE_UNQUOTED([DEFAULT_LOADER_NVRAM], [$with_loader_nvram], + [List of loader:nvram pairs]) +fi
# Some GNULIB base64 symbols clash with a kerberos library AC_DEFINE_UNQUOTED([isbase64],[libvirt_gl_isbase64],[Hack to avoid symbol clash]) ...
Jirka

On Mon, Dec 19, 2016 at 02:16:38PM +0100, Jiri Denemark wrote:
On Fri, Dec 16, 2016 at 10:10:36 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 381 ++++++++++++++--------------------------------- m4/virt-apparmor.m4 | 6 +- m4/virt-driver-bhyve.m4 | 5 +- m4/virt-driver-uml.m4 | 5 +- m4/virt-driver-vz.m4 | 5 +- m4/virt-host-validate.m4 | 5 +- m4/virt-init-script.m4 | 8 +- m4/virt-lib.m4 | 21 +-- m4/virt-login-shell.m4 | 5 +- m4/virt-nss.m4 | 7 +- m4/virt-selinux.m4 | 6 +- m4/virt-wireshark.m4 | 7 +- 12 files changed, 134 insertions(+), 327 deletions(-)
diff --git a/configure.ac b/configure.ac index 3f8e785078..c4f0623b8c 100644 --- a/configure.ac +++ b/configure.ac ... @@ -1033,16 +974,16 @@ LIBXML_CFLAGS="" LIBXML_LIBS="" LIBXML_FOUND="no"
-AC_ARG_WITH([libxml], [AS_HELP_STRING([--with-libxml=@<:@PFX@:>@], - [libxml2 location])]) +LIBVIRT_ARG_WITH_ALT([LIBXML], [libxml2 (>= 2.6.0) location], [check]) + if test "x$with_libxml" = "xno" ; then AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_REQUIRED) AC_MSG_ERROR([libxml2 >= $LIBXML_REQUIRED is required for libvirt]) -elif test "x$with_libxml" = "x" && test "x$PKG_CONFIG" != "x" ; then +elif test "x$with_libxml" != "xno" && test "x$PKG_CONFIG" != "x" ; then PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED, [LIBXML_FOUND=yes], [LIBXML_FOUND=no]) fi if test "$LIBXML_FOUND" = "no" ; then - if test "x$with_libxml" != "x" ; then + if test "x$with_libxml" != "xyes" ; then LIBXML_CONFIG=$with_libxml/bin/$LIBXML_CONFIG fi AC_MSG_CHECKING(libxml2 $LIBXML_CONFIG >= $LIBXML_REQUIRED )
This hunk doesn't seem to be correct. First, "x$with_libxml" != "xno" is always true in the else branch of "x$with_libxml" = "xno". But more importantly, you would remove the option to override the path to libxml using --with-libxml=/path/to/libxml in case another libxml library is installed.
That's true, this is just left over after splitting the changes into separate commits. I'll update it to this: @@ -1033,16 +974,16 @@ LIBXML_CFLAGS="" LIBXML_LIBS="" LIBXML_FOUND="no" -AC_ARG_WITH([libxml], [AS_HELP_STRING([--with-libxml=@<:@PFX@:>@], - [libxml2 location])]) +LIBVIRT_ARG_WITH_ALT([LIBXML], [libxml2 (>= 2.6.0) location], [check]) + if test "x$with_libxml" = "xno" ; then AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_REQUIRED) AC_MSG_ERROR([libxml2 >= $LIBXML_REQUIRED is required for libvirt]) -elif test "x$with_libxml" = "x" && test "x$PKG_CONFIG" != "x" ; then +elif test "x$with_libxml" = "xcheck" && test "x$PKG_CONFIG" != "x" ; then PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED, [LIBXML_FOUND=yes], [L IBXML_FOUND=no]) fi if test "$LIBXML_FOUND" = "no" ; then - if test "x$with_libxml" != "x" ; then + if test "x$with_libxml" != "xcheck" ; then LIBXML_CONFIG=$with_libxml/bin/$LIBXML_CONFIG fi AC_MSG_CHECKING(libxml2 $LIBXML_CONFIG >= $LIBXML_REQUIRED ) or I can change the default action to ''.
...
@@ -2219,18 +2082,20 @@ else default_qemu_group=root fi
-AC_ARG_WITH([qemu-user], - [AS_HELP_STRING([--with-qemu-user], - [username to run QEMU system instance as - @<:@default=platform dependent@:>@])], - [QEMU_USER=${withval}], - [QEMU_USER=${default_qemu_user}]) -AC_ARG_WITH([qemu-group], - [AS_HELP_STRING([--with-qemu-group], - [groupname to run QEMU system instance as - @<:@default=platform dependent@:>@])], - [QEMU_GROUP=${withval}], - [QEMU_GROUP=${default_qemu_group}]) +LIBVIRT_ARG_WITH_ALT([QEMU_USER], [username to run QEMU system instance as], + ['platform dependent'])
Any reason why $default_qemu_user is not used as the default value rather than 'platform dependent'?
I was not able to achieve it after a day of reading documentation and autoconf code and googling. It would be better, but I don't know how and if it's even possible. Pavel

On Mon, Dec 19, 2016 at 15:10:01 +0100, Pavel Hrdina wrote:
On Mon, Dec 19, 2016 at 02:16:38PM +0100, Jiri Denemark wrote:
On Fri, Dec 16, 2016 at 10:10:36 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> ... This hunk doesn't seem to be correct. First, "x$with_libxml" != "xno" is always true in the else branch of "x$with_libxml" = "xno". But more importantly, you would remove the option to override the path to libxml using --with-libxml=/path/to/libxml in case another libxml library is installed.
That's true, this is just left over after splitting the changes into separate commits. I'll update it to this:
@@ -1033,16 +974,16 @@ LIBXML_CFLAGS="" LIBXML_LIBS="" LIBXML_FOUND="no"
-AC_ARG_WITH([libxml], [AS_HELP_STRING([--with-libxml=@<:@PFX@:>@], - [libxml2 location])]) +LIBVIRT_ARG_WITH_ALT([LIBXML], [libxml2 (>= 2.6.0) location], [check]) + if test "x$with_libxml" = "xno" ; then AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_REQUIRED) AC_MSG_ERROR([libxml2 >= $LIBXML_REQUIRED is required for libvirt]) -elif test "x$with_libxml" = "x" && test "x$PKG_CONFIG" != "x" ; then +elif test "x$with_libxml" = "xcheck" && test "x$PKG_CONFIG" != "x" ; then PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED, [LIBXML_FOUND=yes], [L IBXML_FOUND=no]) fi if test "$LIBXML_FOUND" = "no" ; then - if test "x$with_libxml" != "x" ; then + if test "x$with_libxml" != "xcheck" ; then LIBXML_CONFIG=$with_libxml/bin/$LIBXML_CONFIG fi AC_MSG_CHECKING(libxml2 $LIBXML_CONFIG >= $LIBXML_REQUIRED )
ACK
+LIBVIRT_ARG_WITH_ALT([QEMU_USER], [username to run QEMU system instance as], + ['platform dependent'])
Any reason why $default_qemu_user is not used as the default value rather than 'platform dependent'?
I was not able to achieve it after a day of reading documentation and autoconf code and googling. It would be better, but I don't know how and if it's even possible.
And even if you managed to do so, it would really make a lot of sense since $default_qemu_user is based on $with_freebsd and $with_osx which will not be properly set when running configure --help. Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 84 ++++++++++++++++++--------------------------- m4/virt-compile-warnings.m4 | 20 +++++------ 2 files changed, 44 insertions(+), 60 deletions(-) diff --git a/configure.ac b/configure.ac index c4f0623b8c..3ae7034e1c 100644 --- a/configure.ac +++ b/configure.ac @@ -469,10 +469,7 @@ STATIC_BINARIES= AC_SUBST([STATIC_BINARIES]) dnl --enable-debug=(yes|no) -AC_ARG_ENABLE([debug], - [AS_HELP_STRING([--enable-debug=@<:@no|yes@:>@], - [enable debugging output @<:@default=yes@:>@])], - [],[enable_debug=yes]) +LIBVIRT_ARG_ENABLE([DEBUG], [enable debugging output], [yes]) AM_CONDITIONAL([ENABLE_DEBUG], test x"$enable_debug" = x"yes") if test x"$enable_debug" = x"yes"; then AC_DEFINE([ENABLE_DEBUG], [], [whether debugging is enabled]) @@ -1806,18 +1803,18 @@ fi AC_MSG_RESULT([$with_test_suite]) AM_CONDITIONAL([WITH_TESTS], [test "$with_test_suite" = "yes"]) -AC_ARG_ENABLE([expensive-tests], - [AS_HELP_STRING([--enable-expensive-tests], - [set the default for enabling expensive tests (gnulib and long timeouts) ] - [@<:@default=check@:>@; use VIR_TEST_EXPENSIVE to override during make])], - [case $enableval in - 0|no) VIR_TEST_EXPENSIVE_DEFAULT=0 ;; - 1|yes) VIR_TEST_EXPENSIVE_DEFAULT=1 ;; - check) ;; - *) AC_MSG_ERROR([bad value ${enableval} for enable-expensive-tests option]) - ;; - esac], [enableval=check]) -if test "$enableval" = check; then +LIBVIRT_ARG_ENABLE([EXPENSIVE_TESTS], + [set the default for enabling expensive tests ] + [(gnulib and long timeouts), use VIR_TEST_EXPENSIVE to ] + [override during make], + [check]) +case "$enable_expensive_tests" in + 0|no) VIR_TEST_EXPENSIVE_DEFAULT=0 ;; + 1|yes) VIR_TEST_EXPENSIVE_DEFAULT=1 ;; + check) ;; + *) AC_MSG_ERROR([bad value ${enable_expensive_tests} for enable-expensive-tests option]) ;; +esac +if test "$enable_expensive_tests" = check; then if test -d $srcdir/.git ; then VIR_TEST_EXPENSIVE_DEFAULT=0 else @@ -1827,17 +1824,13 @@ fi AC_SUBST([VIR_TEST_EXPENSIVE_DEFAULT]) AM_CONDITIONAL([WITH_EXPENSIVE_TESTS], [test $VIR_TEST_EXPENSIVE_DEFAULT = 1]) -AC_ARG_ENABLE([test-coverage], - [AS_HELP_STRING([--enable-test-coverage], - [turn on code coverage instrumentation @<:@default=no@:>@])], -[case "${enableval}" in - yes|no) ;; - *) AC_MSG_ERROR([bad value ${enableval} for test-coverage option]) ;; - esac], - [enableval=no]) -enable_coverage=$enableval - -if test "${enable_coverage}" = yes; then +LIBVIRT_ARG_ENABLE([TEST_COVERAGE], [turn on code coverage instrumentation], [no]) +case "$enable_test_coverage" in + yes|no) ;; + *) AC_MSG_ERROR([bad value ${enable_test_coverga} for test-coverage option]) ;; +esac + +if test "$enable_test_coverage" = yes; then save_WARN_CFLAGS=$WARN_CFLAGS WARN_CFLAGS= gl_WARN_ADD([-fprofile-arcs]) @@ -1848,17 +1841,13 @@ if test "${enable_coverage}" = yes; then WARN_CFLAGS=$save_WARN_CFLAGS fi -AC_ARG_ENABLE([test-oom], - [AS_HELP_STRING([--enable-test-oom], - [memory allocation failure checking @<:@default=no@:>@])], -[case "${enableval}" in - yes|no) ;; - *) AC_MSG_ERROR([bad value ${enableval} for test-oom option]) ;; - esac], - [enableval=no]) -enable_oom=$enableval +LIBVIRT_ARG_ENABLE([TEST_OOM], [memory allocation failure checking], [no]) +case "$enable_test_oom" in + yes|no) ;; + *) AC_MSG_ERROR([bad value ${enable_test_oom} for test-oom option]) ;; +esac -if test "${enable_oom}" = yes; then +if test "$enable_test_oom" = yes; then have_trace=yes AC_CHECK_HEADER([execinfo.h],[],[have_trace=no]) AC_CHECK_FUNC([backtrace],[],[have_trace=no]) @@ -1868,22 +1857,17 @@ if test "${enable_oom}" = yes; then AC_DEFINE([TEST_OOM], 1, [Whether malloc OOM checking is enabled]) fi +LIBVIRT_ARG_ENABLE([TEST_LOCKING], [thread locking tests using CIL], [no]) +case "$enable_test_locking" in + yes|no) ;; + *) AC_MSG_ERROR([bad value ${enable_test_locking} for test-locking option]) ;; +esac -AC_ARG_ENABLE([test-locking], - [AS_HELP_STRING([--enable-test-locking], - [thread locking tests using CIL @<:@default=no@:>@])], -[case "${enableval}" in - yes|no) ;; - *) AC_MSG_ERROR([bad value ${enableval} for test-locking option]) ;; - esac], - [enableval=no]) -enable_locking=$enableval - -if test "$enable_locking" = "yes"; then +if test "$enable_test_locking" = "yes"; then LOCK_CHECKING_CFLAGS="-save-temps" AC_SUBST([LOCK_CHECKING_CFLAGS]) fi -AM_CONDITIONAL([WITH_CIL],[test "$enable_locking" = "yes"]) +AM_CONDITIONAL([WITH_CIL],[test "$enable_test_locking" = "yes"]) dnl Enable building libvirtd? AM_CONDITIONAL([WITH_LIBVIRTD],[test "x$with_libvirtd" = "xyes"]) @@ -2514,7 +2498,7 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Miscellaneous]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([ Debug: $enable_debug]) -AC_MSG_NOTICE([ Use -Werror: $set_werror]) +AC_MSG_NOTICE([ Use -Werror: $enable_werror]) AC_MSG_NOTICE([ Warning Flags: $WARN_CFLAGS]) AC_MSG_NOTICE([ DTrace: $with_dtrace]) AC_MSG_NOTICE([ numad: $with_numad]) diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4 index eb689e2f88..17fdf9d14b 100644 --- a/m4/virt-compile-warnings.m4 +++ b/m4/virt-compile-warnings.m4 @@ -7,15 +7,15 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[ dnl More compiler warnings dnl ****************************** - AC_ARG_ENABLE([werror], - AS_HELP_STRING([--enable-werror], [Use -Werror (if supported)]), - [set_werror="$enableval"], - [if test -d $srcdir/.git; then - is_git_version=true - set_werror=yes - else - set_werror=no - fi]) + LIBVIRT_ARG_ENABLE([WERROR], [Use -Werror (if supported)], [check]) + if test "$enable_werror" = "check"; then + if test -d $srcdir/.git; then + is_git_version=true + enable_werror=yes + else + enable_werror=no + fi + fi # List of warnings that are not relevant / wanted @@ -208,7 +208,7 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[ wantwarn="$wantwarn -Wno-suggest-attribute=pure" wantwarn="$wantwarn -Wno-suggest-attribute=const" - if test "$set_werror" = "yes" + if test "$enable_werror" = "yes" then wantwarn="$wantwarn -Werror" fi -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:37 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 84 ++++++++++++++++++--------------------------- m4/virt-compile-warnings.m4 | 20 +++++------ 2 files changed, 44 insertions(+), 60 deletions(-)
ACK Jirka

Following patch will update LIBVIRT_CHECK_(LIB|LIB_ALT|PKG) macros in a way that you will be able to call a another macro as a fallback if the first one fails. To allow that, we need to move the LIBVIRT_ARG_WITH out of those macro to not have two or more same lines in output of "configure --help". Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-apparmor.m4 | 1 + m4/virt-attr.m4 | 1 + m4/virt-audit.m4 | 1 + m4/virt-avahi.m4 | 1 + m4/virt-blkid.m4 | 1 + m4/virt-capng.m4 | 1 + m4/virt-curl.m4 | 1 + m4/virt-dbus.m4 | 1 + m4/virt-fuse.m4 | 1 + m4/virt-gluster.m4 | 1 + m4/virt-gnutls.m4 | 1 + m4/virt-hal.m4 | 1 + m4/virt-lib.m4 | 12 ------------ m4/virt-libssh.m4 | 1 + m4/virt-netcf.m4 | 1 + m4/virt-numactl.m4 | 1 + m4/virt-openwsman.m4 | 1 + m4/virt-pciaccess.m4 | 1 + m4/virt-readline.m4 | 2 ++ m4/virt-sanlock.m4 | 1 + m4/virt-sasl.m4 | 1 + m4/virt-selinux.m4 | 1 + m4/virt-ssh2.m4 | 1 + m4/virt-udev.m4 | 1 + m4/virt-wireshark.m4 | 1 + m4/virt-yajl.m4 | 2 ++ 26 files changed, 27 insertions(+), 12 deletions(-) diff --git a/m4/virt-apparmor.m4 b/m4/virt-apparmor.m4 index eb017d181b..d60bb177fe 100644 --- a/m4/virt-apparmor.m4 +++ b/m4/virt-apparmor.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_APPARMOR],[ + LIBVIRT_ARG_WITH([APPARMOR], [AppArmor], [check]) LIBVIRT_CHECK_LIB([APPARMOR], [apparmor], [aa_change_profile], [sys/apparmor.h]) diff --git a/m4/virt-attr.m4 b/m4/virt-attr.m4 index 341b35b98a..b36498f9de 100644 --- a/m4/virt-attr.m4 +++ b/m4/virt-attr.m4 @@ -1,6 +1,7 @@ dnl The libattr.so library AC_DEFUN([LIBVIRT_CHECK_ATTR],[ + LIBVIRT_ARG_WITH([ATTR], [attr], [check]) LIBVIRT_CHECK_LIB([ATTR], [attr], [getxattr], [attr/xattr.h]) ]) diff --git a/m4/virt-audit.m4 b/m4/virt-audit.m4 index 60bf76cc7f..0c09e4f723 100644 --- a/m4/virt-audit.m4 +++ b/m4/virt-audit.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_AUDIT],[ + LIBVIRT_ARG_WITH([AUDIT], [audit], [check]) LIBVIRT_CHECK_LIB([AUDIT], [audit], [audit_encode_nv_string], [libaudit.h]) ]) diff --git a/m4/virt-avahi.m4 b/m4/virt-avahi.m4 index d0ac86c235..7a054145cf 100644 --- a/m4/virt-avahi.m4 +++ b/m4/virt-avahi.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_AVAHI],[ + LIBVIRT_ARG_WITH([AVAHI], [avahi-client], [check], [0.6.0]) LIBVIRT_CHECK_PKG([AVAHI], [avahi-client], [0.6.0]) ]) diff --git a/m4/virt-blkid.m4 b/m4/virt-blkid.m4 index 69b7cf47c1..fb95eb9106 100644 --- a/m4/virt-blkid.m4 +++ b/m4/virt-blkid.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_BLKID],[ + LIBVIRT_ARG_WITH([BLKID], [blkid], [check], [2.17]) LIBVIRT_CHECK_PKG([BLKID], [blkid], [2.17]) ]) diff --git a/m4/virt-capng.m4 b/m4/virt-capng.m4 index ab08321c90..6105dbae6b 100644 --- a/m4/virt-capng.m4 +++ b/m4/virt-capng.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_CAPNG],[ + LIBVIRT_ARG_WITH([CAPNG], [cap-ng], [check]) LIBVIRT_CHECK_LIB([CAPNG], [cap-ng], [capng_updatev], [cap-ng.h]) ]) diff --git a/m4/virt-curl.m4 b/m4/virt-curl.m4 index 8b71119b86..ef87888a54 100644 --- a/m4/virt-curl.m4 +++ b/m4/virt-curl.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_CURL],[ + LIBVIRT_ARG_WITH([CURL], [libcurl], [check], [7.18.0]) LIBVIRT_CHECK_PKG([CURL], [libcurl], [7.18.0]) # XXX as of libcurl-devel-7.20.1-3.fc13.x86_64, curl ships a version diff --git a/m4/virt-dbus.m4 b/m4/virt-dbus.m4 index 3f9b30686c..ae13488850 100644 --- a/m4/virt-dbus.m4 +++ b/m4/virt-dbus.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_DBUS],[ + LIBVIRT_ARG_WITH([DBUS], [dbus-1], [check], [1.0.0]) LIBVIRT_CHECK_PKG([DBUS], [dbus-1], [1.0.0]) if test "$with_dbus" = "yes" ; then diff --git a/m4/virt-fuse.m4 b/m4/virt-fuse.m4 index 0e723f2589..298406b597 100644 --- a/m4/virt-fuse.m4 +++ b/m4/virt-fuse.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_FUSE],[ + LIBVIRT_ARG_WITH([FUSE], [fuse], [check], [2.8.6]) LIBVIRT_CHECK_PKG([FUSE], [fuse], [2.8.6]) ]) diff --git a/m4/virt-gluster.m4 b/m4/virt-gluster.m4 index 5a4a263c9e..dc9e8aff6b 100644 --- a/m4/virt-gluster.m4 +++ b/m4/virt-gluster.m4 @@ -20,6 +20,7 @@ dnl dnl Currently tested against Fedora 19 with glusterfs 3.4.1; earlier dnl versions may be possible but only with further testing AC_DEFUN([LIBVIRT_CHECK_GLUSTER],[ + LIBVIRT_ARG_WITH([GLUSTERFS], [glusterfs], [check], [3.4.1]) LIBVIRT_CHECK_PKG([GLUSTERFS], [glusterfs-api], [3.4.1]) ]) diff --git a/m4/virt-gnutls.m4 b/m4/virt-gnutls.m4 index 5bca950bcd..1e60f28da2 100644 --- a/m4/virt-gnutls.m4 +++ b/m4/virt-gnutls.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_GNUTLS],[ + LIBVIRT_ARG_WITH([GNUTLS], [gnutls], [check], [2.2.0]) LIBVIRT_CHECK_PKG([GNUTLS], [gnutls], [2.2.0]) if test "$with_gnutls" = "yes" ; then diff --git a/m4/virt-hal.m4 b/m4/virt-hal.m4 index 49a843064f..38aa7b2d8d 100644 --- a/m4/virt-hal.m4 +++ b/m4/virt-hal.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_HAL],[ + LIBVIRT_ARG_WITH([HAL], [hal], [check], [0.5.0]) LIBVIRT_CHECK_PKG([HAL], [hal], [0.5.0]) ]) diff --git a/m4/virt-lib.m4 b/m4/virt-lib.m4 index 473d184880..7d7e597b66 100644 --- a/m4/virt-lib.m4 +++ b/m4/virt-lib.m4 @@ -54,7 +54,6 @@ AC_DEFUN([LIBVIRT_CHECK_LIB],[ m4_pushdef([header_name], [$4]) m4_pushdef([check_name_lc], m4_tolower(check_name)) - m4_pushdef([check_name_dash], m4_translit(check_name_lc, [_], [-])) m4_pushdef([config_var], [WITH_]check_name) m4_pushdef([make_var], [WITH_]check_name) @@ -62,8 +61,6 @@ AC_DEFUN([LIBVIRT_CHECK_LIB],[ m4_pushdef([libs_var], check_name[_LIBS]) m4_pushdef([with_var], [with_]check_name_lc) - LIBVIRT_ARG_WITH(check_name, library_name, [check]) - old_LIBS=$LIBS old_CFLAGS=$CFLAGS cflags_var= @@ -122,7 +119,6 @@ AC_DEFUN([LIBVIRT_CHECK_LIB],[ m4_popdef([make_var]) m4_popdef([config_var]) - m4_popdef([check_name_dash]) m4_popdef([check_name_lc]) m4_popdef([header_name]) @@ -179,7 +175,6 @@ AC_DEFUN([LIBVIRT_CHECK_LIB_ALT],[ m4_pushdef([header_name_alt], [$8]) m4_pushdef([check_name_lc], m4_tolower(check_name)) - m4_pushdef([check_name_dash], m4_translit(check_name_lc, [_], [-])) m4_pushdef([config_var], [WITH_]check_name) m4_pushdef([make_var], [WITH_]check_name) @@ -189,8 +184,6 @@ AC_DEFUN([LIBVIRT_CHECK_LIB_ALT],[ m4_pushdef([config_var_alt], [WITH_]check_name_alt) m4_pushdef([make_var_alt], [WITH_]check_name_alt) - LIBVIRT_ARG_WITH(check_name, library_name, [check]) - old_LIBS=$LIBS old_CFLAGS=$CFLAGS cflags_var= @@ -266,7 +259,6 @@ AC_DEFUN([LIBVIRT_CHECK_LIB_ALT],[ m4_popdef([config_var]) m4_popdef([check_name_lc]) - m4_popdef([check_name_dash]) m4_popdef([header_name_alt]) m4_popdef([function_name_alt]) @@ -304,7 +296,6 @@ AC_DEFUN([LIBVIRT_CHECK_PKG],[ m4_pushdef([pc_version], [$3]) m4_pushdef([check_name_lc], m4_tolower(check_name)) - m4_pushdef([check_name_dash], m4_translit(check_name_lc, [_], [-])) m4_pushdef([config_var], [WITH_]check_name) m4_pushdef([make_var], [WITH_]check_name) @@ -312,8 +303,6 @@ AC_DEFUN([LIBVIRT_CHECK_PKG],[ m4_pushdef([libs_var], check_name[_LIBS]) m4_pushdef([with_var], [with_]check_name_lc) - LIBVIRT_ARG_WITH(check_name, pc_name, [check], pc_version) - fail=0 if test "x$with_var" != "xno" ; then PKG_CHECK_MODULES(check_name, pc_name[ >= ]pc_version, [ @@ -343,7 +332,6 @@ AC_DEFUN([LIBVIRT_CHECK_PKG],[ m4_popdef([config_var]) m4_popdef([check_name_lc]) - m4_popdef([check_name_dash]) m4_popdef([pc_version]) m4_popdef([pc_name]) diff --git a/m4/virt-libssh.m4 b/m4/virt-libssh.m4 index 88ece21b26..b5912acae3 100644 --- a/m4/virt-libssh.m4 +++ b/m4/virt-libssh.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_LIBSSH],[ + LIBVIRT_ARG_WITH([LIBSSH], [libssh], [check], [0.7]) LIBVIRT_CHECK_PKG([LIBSSH], [libssh], [0.7]) ]) diff --git a/m4/virt-netcf.m4 b/m4/virt-netcf.m4 index 7e0ee83fc5..eb919afd7c 100644 --- a/m4/virt-netcf.m4 +++ b/m4/virt-netcf.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_NETCF],[ + LIBVIRT_ARG_WITH([NETCF], [netcf], [check], [0.1.4]) LIBVIRT_CHECK_PKG([NETCF], [netcf], [0.1.4]) if test "$with_netcf" = "yes" ; then diff --git a/m4/virt-numactl.m4 b/m4/virt-numactl.m4 index fa66d246c1..6f62c51d5b 100644 --- a/m4/virt-numactl.m4 +++ b/m4/virt-numactl.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_NUMACTL],[ + LIBVIRT_ARG_WITH([NUMACTL], [numa], [check]) LIBVIRT_CHECK_LIB([NUMACTL], [numa], [numa_available], [numa.h]) AC_CHECK_LIB([numa], [numa_bitmask_isbitset], [have_numa_bitmask_isbitset=yes]) if test "$have_numa_bitmask_isbitset" = "yes"; then diff --git a/m4/virt-openwsman.m4 b/m4/virt-openwsman.m4 index 8ab18c6aac..5f6a4eb047 100644 --- a/m4/virt-openwsman.m4 +++ b/m4/virt-openwsman.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_OPENWSMAN],[ + LIBVIRT_ARG_WITH([OPENWSMAN], [openwsman], [check], [2.2.3]) LIBVIRT_CHECK_PKG([OPENWSMAN], [openwsman], [2.2.3]) ]) diff --git a/m4/virt-pciaccess.m4 b/m4/virt-pciaccess.m4 index 2f5c958126..9a29fe9020 100644 --- a/m4/virt-pciaccess.m4 +++ b/m4/virt-pciaccess.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_PCIACCESS],[ + LIBVIRT_ARG_WITH([PCIACCESS], [pciaccess], [check], [0.10.0]) LIBVIRT_CHECK_PKG([PCIACCESS], [pciaccess], [0.10.0]) ]) diff --git a/m4/virt-readline.m4 b/m4/virt-readline.m4 index 775c186764..c1c8fa87cd 100644 --- a/m4/virt-readline.m4 +++ b/m4/virt-readline.m4 @@ -18,6 +18,8 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_READLINE],[ + LIBVIRT_ARG_WITH([READLINE], [readline], [check]) + extra_LIBS= lv_saved_libs=$LIBS if test "x$with_readline" != xno; then diff --git a/m4/virt-sanlock.m4 b/m4/virt-sanlock.m4 index 3c30cbfdf2..64f950bd70 100644 --- a/m4/virt-sanlock.m4 +++ b/m4/virt-sanlock.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_SANLOCK],[ + LIBVIRT_ARG_WITH([SANLOCK], [sanlock-client], [check]) LIBVIRT_CHECK_LIB([SANLOCK], [sanlock_client], [sanlock_init], [sanlock.h]) if test "x$with_sanlock" = "xyes" ; then diff --git a/m4/virt-sasl.m4 b/m4/virt-sasl.m4 index 8fb5d7f4ff..9e5fe03867 100644 --- a/m4/virt-sasl.m4 +++ b/m4/virt-sasl.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_SASL],[ + LIBVIRT_ARG_WITH([SASL], [sasl], [check]) LIBVIRT_CHECK_LIB_ALT([SASL], [sasl2], [sasl_client_init], [sasl/sasl.h], [SASL1], [sasl], diff --git a/m4/virt-selinux.m4 b/m4/virt-selinux.m4 index afc4772c2d..992066ad2e 100644 --- a/m4/virt-selinux.m4 +++ b/m4/virt-selinux.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_SELINUX],[ + LIBVIRT_ARG_WITH([SELINUX], [SELinux], [check]) LIBVIRT_CHECK_LIB([SELINUX], [selinux], [fgetfilecon_raw], [selinux/selinux.h]) diff --git a/m4/virt-ssh2.m4 b/m4/virt-ssh2.m4 index 4479fbaea7..ed3bebbe99 100644 --- a/m4/virt-ssh2.m4 +++ b/m4/virt-ssh2.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_SSH2],[ + LIBVIRT_ARG_WITH([SSH2], [libssh2], [check], [1.3]) LIBVIRT_CHECK_PKG([SSH2], [libssh2], [1.3]) ]) diff --git a/m4/virt-udev.m4 b/m4/virt-udev.m4 index 29ab30a5e8..3ac4c40732 100644 --- a/m4/virt-udev.m4 +++ b/m4/virt-udev.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_UDEV],[ + LIBVIRT_ARG_WITH([UDEV], [libudev], [check], [145]) AC_REQUIRE([LIBVIRT_CHECK_PCIACCESS]) LIBVIRT_CHECK_PKG([UDEV], [libudev], [145]) diff --git a/m4/virt-wireshark.m4 b/m4/virt-wireshark.m4 index 89976ba3f9..d11bec05b5 100644 --- a/m4/virt-wireshark.m4 +++ b/m4/virt-wireshark.m4 @@ -18,6 +18,7 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_WIRESHARK],[ + LIBVIRT_ARG_WITH([WIRESHARK_DISSECTOR], [wireshark], [check], [1.11.3]) LIBVIRT_CHECK_PKG([WIRESHARK_DISSECTOR], [wireshark], [1.11.3]) LIBVIRT_ARG_WITH_ALT([WS_PLUGINDIR], diff --git a/m4/virt-yajl.m4 b/m4/virt-yajl.m4 index 8c452adca6..87271addad 100644 --- a/m4/virt-yajl.m4 +++ b/m4/virt-yajl.m4 @@ -18,6 +18,8 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_CHECK_YAJL],[ + LIBVIRT_ARG_WITH([YAJL], [yajl], [check]) + dnl YAJL JSON library http://lloyd.github.com/yajl/ if test "$with_qemu:$with_yajl" = yes:check; then dnl Some versions of qemu require the use of yajl; try to detect them -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:38 +0100, Pavel Hrdina wrote:
Following patch will update LIBVIRT_CHECK_(LIB|LIB_ALT|PKG) macros in a way that you will be able to call a another macro as a fallback if the first one fails. To allow that, we need to move the LIBVIRT_ARG_WITH out of those macro to not have two or more same lines in output of "configure --help".
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> ... diff --git a/m4/virt-lib.m4 b/m4/virt-lib.m4 index 473d184880..7d7e597b66 100644 --- a/m4/virt-lib.m4 +++ b/m4/virt-lib.m4 @@ -54,7 +54,6 @@ AC_DEFUN([LIBVIRT_CHECK_LIB],[ m4_pushdef([header_name], [$4])
m4_pushdef([check_name_lc], m4_tolower(check_name)) - m4_pushdef([check_name_dash], m4_translit(check_name_lc, [_], [-]))
The removal of check_name_dash macros should be done in the patch which replaced AC_ARG_WITH with LIBVIRT_ARG_WITH. Not a big deal though so it's up to you if you move it. ACK Jirka

Usage of AC_REQUIRE will mess with order how LIBVIRT_CHECK_* macros are composed into configure.ac. This ensures that the output of configure --help is properly ordered and grouped into sections. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 33 +++++++++++++++++++++++++++++++++ m4/virt-apparmor.m4 | 8 +++++--- m4/virt-attr.m4 | 5 ++++- m4/virt-audit.m4 | 5 ++++- m4/virt-avahi.m4 | 5 ++++- m4/virt-blkid.m4 | 5 ++++- m4/virt-capng.m4 | 5 ++++- m4/virt-curl.m4 | 5 ++++- m4/virt-dbus.m4 | 5 ++++- m4/virt-driver-bhyve.m4 | 4 +++- m4/virt-driver-uml.m4 | 4 +++- m4/virt-driver-vz.m4 | 4 +++- m4/virt-fuse.m4 | 5 ++++- m4/virt-gluster.m4 | 5 ++++- m4/virt-gnutls.m4 | 5 ++++- m4/virt-hal.m4 | 5 ++++- m4/virt-host-validate.m4 | 4 +++- m4/virt-init-script.m4 | 4 +++- m4/virt-libssh.m4 | 5 ++++- m4/virt-login-shell.m4 | 4 +++- m4/virt-netcf.m4 | 5 ++++- m4/virt-nss.m4 | 4 +++- m4/virt-numactl.m4 | 5 ++++- m4/virt-openwsman.m4 | 5 ++++- m4/virt-pciaccess.m4 | 5 ++++- m4/virt-readline.m4 | 4 +++- m4/virt-sanlock.m4 | 5 ++++- m4/virt-sasl.m4 | 5 ++++- m4/virt-selinux.m4 | 8 +++++--- m4/virt-ssh2.m4 | 5 ++++- m4/virt-udev.m4 | 5 ++++- m4/virt-wireshark.m4 | 8 +++++--- m4/virt-yajl.m4 | 4 +++- 33 files changed, 155 insertions(+), 38 deletions(-) diff --git a/configure.ac b/configure.ac index 3ae7034e1c..a710a4f050 100644 --- a/configure.ac +++ b/configure.ac @@ -232,6 +232,33 @@ LIBVIRT_COMPILE_PIE LIBVIRT_LINKER_RELRO LIBVIRT_LINKER_NO_INDIRECT +LIBVIRT_ARG_APPARMOR +LIBVIRT_ARG_ATTR +LIBVIRT_ARG_AUDIT +LIBVIRT_ARG_AVAHI +LIBVIRT_ARG_BLKID +LIBVIRT_ARG_CAPNG +LIBVIRT_ARG_CURL +LIBVIRT_ARG_DBUS +LIBVIRT_ARG_FUSE +LIBVIRT_ARG_GLUSTER +LIBVIRT_ARG_GNUTLS +LIBVIRT_ARG_HAL +LIBVIRT_ARG_LIBSSH +LIBVIRT_ARG_NETCF +LIBVIRT_ARG_NSS +LIBVIRT_ARG_NUMACTL +LIBVIRT_ARG_OPENWSMAN +LIBVIRT_ARG_PCIACCESS +LIBVIRT_ARG_READLINE +LIBVIRT_ARG_SANLOCK +LIBVIRT_ARG_SASL +LIBVIRT_ARG_SELINUX +LIBVIRT_ARG_SSH2 +LIBVIRT_ARG_UDEV +LIBVIRT_ARG_WIRESHARK +LIBVIRT_ARG_YAJL + LIBVIRT_CHECK_APPARMOR LIBVIRT_CHECK_ATTR LIBVIRT_CHECK_AUDIT @@ -475,6 +502,7 @@ if test x"$enable_debug" = x"yes"; then AC_DEFINE([ENABLE_DEBUG], [], [whether debugging is enabled]) fi +LIBVIRT_ARG_INIT_SCRIPT LIBVIRT_CHECK_INIT_SCRIPT AC_MSG_CHECKING([for whether to install sysctl config]) @@ -896,12 +924,14 @@ dnl dnl Check for virt-login-shell dnl +LIBVIRT_ARG_LOGIN_SHELL LIBVIRT_CHECK_LOGIN_SHELL dnl dnl Check for virt-host-validate dnl +LIBVIRT_ARG_HOST_VALIDATE LIBVIRT_CHECK_HOST_VALIDATE AM_CONDITIONAL([WITH_SETUID_RPC_CLIENT], [test "$with_lxc$with_login_shell" != "nono"]) @@ -910,12 +940,14 @@ dnl dnl Checks for the Parallels driver dnl +LIBVIRT_DRIVER_ARG_VZ LIBVIRT_DRIVER_CHECK_VZ dnl dnl Checks for bhyve driver dnl +LIBVIRT_DRIVER_ARG_BHYVE LIBVIRT_DRIVER_CHECK_BHYVE @@ -1279,6 +1311,7 @@ dnl dnl Checks for the UML driver dnl +LIBVIRT_DRIVER_ARG_UML LIBVIRT_DRIVER_CHECK_UML dnl diff --git a/m4/virt-apparmor.m4 b/m4/virt-apparmor.m4 index d60bb177fe..22818f2a98 100644 --- a/m4/virt-apparmor.m4 +++ b/m4/virt-apparmor.m4 @@ -17,13 +17,15 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_APPARMOR],[ +AC_DEFUN([LIBVIRT_ARG_APPARMOR],[ LIBVIRT_ARG_WITH([APPARMOR], [AppArmor], [check]) + LIBVIRT_ARG_WITH_ALT([APPARMOR_MOUNT], [set AppArmor mount point], [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_APPARMOR],[ LIBVIRT_CHECK_LIB([APPARMOR], [apparmor], [aa_change_profile], [sys/apparmor.h]) - LIBVIRT_ARG_WITH_ALT([APPARMOR_MOUNT], [set AppArmor mount point], [check]) - if test "$with_apparmor" = "yes"; then AC_DEFINE_UNQUOTED([APPARMOR_DIR], "/etc/apparmor.d", diff --git a/m4/virt-attr.m4 b/m4/virt-attr.m4 index b36498f9de..dcb2678b19 100644 --- a/m4/virt-attr.m4 +++ b/m4/virt-attr.m4 @@ -1,7 +1,10 @@ dnl The libattr.so library -AC_DEFUN([LIBVIRT_CHECK_ATTR],[ +AC_DEFUN([LIBVIRT_ARG_ATTR],[ LIBVIRT_ARG_WITH([ATTR], [attr], [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_ATTR],[ LIBVIRT_CHECK_LIB([ATTR], [attr], [getxattr], [attr/xattr.h]) ]) diff --git a/m4/virt-audit.m4 b/m4/virt-audit.m4 index 0c09e4f723..68b6f578ca 100644 --- a/m4/virt-audit.m4 +++ b/m4/virt-audit.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_AUDIT],[ +AC_DEFUN([LIBVIRT_ARG_AUDIT],[ LIBVIRT_ARG_WITH([AUDIT], [audit], [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_AUDIT],[ LIBVIRT_CHECK_LIB([AUDIT], [audit], [audit_encode_nv_string], [libaudit.h]) ]) diff --git a/m4/virt-avahi.m4 b/m4/virt-avahi.m4 index 7a054145cf..f36af6ddb1 100644 --- a/m4/virt-avahi.m4 +++ b/m4/virt-avahi.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_AVAHI],[ +AC_DEFUN([LIBVIRT_ARG_AVAHI],[ LIBVIRT_ARG_WITH([AVAHI], [avahi-client], [check], [0.6.0]) +]) + +AC_DEFUN([LIBVIRT_CHECK_AVAHI],[ LIBVIRT_CHECK_PKG([AVAHI], [avahi-client], [0.6.0]) ]) diff --git a/m4/virt-blkid.m4 b/m4/virt-blkid.m4 index fb95eb9106..db225a1d9a 100644 --- a/m4/virt-blkid.m4 +++ b/m4/virt-blkid.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_BLKID],[ +AC_DEFUN([LIBVIRT_ARG_BLKID],[ LIBVIRT_ARG_WITH([BLKID], [blkid], [check], [2.17]) +]) + +AC_DEFUN([LIBVIRT_CHECK_BLKID],[ LIBVIRT_CHECK_PKG([BLKID], [blkid], [2.17]) ]) diff --git a/m4/virt-capng.m4 b/m4/virt-capng.m4 index 6105dbae6b..3fbc79565d 100644 --- a/m4/virt-capng.m4 +++ b/m4/virt-capng.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_CAPNG],[ +AC_DEFUN([LIBVIRT_ARG_CAPNG],[ LIBVIRT_ARG_WITH([CAPNG], [cap-ng], [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_CAPNG],[ LIBVIRT_CHECK_LIB([CAPNG], [cap-ng], [capng_updatev], [cap-ng.h]) ]) diff --git a/m4/virt-curl.m4 b/m4/virt-curl.m4 index ef87888a54..7194d7a4be 100644 --- a/m4/virt-curl.m4 +++ b/m4/virt-curl.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_CURL],[ +AC_DEFUN([LIBVIRT_ARG_CURL],[ LIBVIRT_ARG_WITH([CURL], [libcurl], [check], [7.18.0]) +]) + +AC_DEFUN([LIBVIRT_CHECK_CURL],[ LIBVIRT_CHECK_PKG([CURL], [libcurl], [7.18.0]) # XXX as of libcurl-devel-7.20.1-3.fc13.x86_64, curl ships a version diff --git a/m4/virt-dbus.m4 b/m4/virt-dbus.m4 index ae13488850..8e1fad1c02 100644 --- a/m4/virt-dbus.m4 +++ b/m4/virt-dbus.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_DBUS],[ +AC_DEFUN([LIBVIRT_ARG_DBUS],[ LIBVIRT_ARG_WITH([DBUS], [dbus-1], [check], [1.0.0]) +]) + +AC_DEFUN([LIBVIRT_CHECK_DBUS],[ LIBVIRT_CHECK_PKG([DBUS], [dbus-1], [1.0.0]) if test "$with_dbus" = "yes" ; then diff --git a/m4/virt-driver-bhyve.m4 b/m4/virt-driver-bhyve.m4 index c83eff08e9..1927929922 100644 --- a/m4/virt-driver-bhyve.m4 +++ b/m4/virt-driver-bhyve.m4 @@ -17,9 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_DRIVER_CHECK_BHYVE],[ +AC_DEFUN([LIBVIRT_DRIVER_ARG_BHYVE],[ LIBVIRT_ARG_WITH([BHYVE], [BHyVe], [check]) +]) +AC_DEFUN([LIBVIRT_DRIVER_CHECK_BHYVE],[ if test "$with_bhyve" != "no"; then AC_PATH_PROG([BHYVE], [bhyve], [], [$PATH:/usr/sbin]) AC_PATH_PROG([BHYVECTL], [bhyvectl], [], [$PATH:/usr/sbin]) diff --git a/m4/virt-driver-uml.m4 b/m4/virt-driver-uml.m4 index bc3f7d5a45..24ca93845a 100644 --- a/m4/virt-driver-uml.m4 +++ b/m4/virt-driver-uml.m4 @@ -17,9 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_DRIVER_CHECK_UML],[ +AC_DEFUN([LIBVIRT_DRIVER_ARG_UML],[ LIBVIRT_ARG_WITH([UML], [UML], [check]) +]) +AC_DEFUN([LIBVIRT_DRIVER_CHECK_UML],[ if test "$with_libvirtd" = "no" || test "$with_linux" = "no"; then if test "$with_uml" = "yes"; then AC_MSG_ERROR([The UML driver cannot be enabled]) diff --git a/m4/virt-driver-vz.m4 b/m4/virt-driver-vz.m4 index a51857467e..74ef79a9a7 100644 --- a/m4/virt-driver-vz.m4 +++ b/m4/virt-driver-vz.m4 @@ -17,9 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_DRIVER_CHECK_VZ],[ +AC_DEFUN([LIBVIRT_DRIVER_ARG_VZ],[ LIBVIRT_ARG_WITH([VZ], [Virtuozzo], [check]) +]) +AC_DEFUN([LIBVIRT_DRIVER_CHECK_VZ],[ if test "$with_vz" = "yes" || test "$with_vz" = "check"; then PKG_CHECK_MODULES([PARALLELS_SDK], [parallels-sdk >= $PARALLELS_SDK_REQUIRED], diff --git a/m4/virt-fuse.m4 b/m4/virt-fuse.m4 index 298406b597..5f25b32ba3 100644 --- a/m4/virt-fuse.m4 +++ b/m4/virt-fuse.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_FUSE],[ +AC_DEFUN([LIBVIRT_ARG_FUSE],[ LIBVIRT_ARG_WITH([FUSE], [fuse], [check], [2.8.6]) +]) + +AC_DEFUN([LIBVIRT_CHECK_FUSE],[ LIBVIRT_CHECK_PKG([FUSE], [fuse], [2.8.6]) ]) diff --git a/m4/virt-gluster.m4 b/m4/virt-gluster.m4 index dc9e8aff6b..5398cc32d8 100644 --- a/m4/virt-gluster.m4 +++ b/m4/virt-gluster.m4 @@ -19,8 +19,11 @@ dnl dnl Currently tested against Fedora 19 with glusterfs 3.4.1; earlier dnl versions may be possible but only with further testing -AC_DEFUN([LIBVIRT_CHECK_GLUSTER],[ +AC_DEFUN([LIBVIRT_ARG_GLUSTER],[ LIBVIRT_ARG_WITH([GLUSTERFS], [glusterfs], [check], [3.4.1]) +]) + +AC_DEFUN([LIBVIRT_CHECK_GLUSTER],[ LIBVIRT_CHECK_PKG([GLUSTERFS], [glusterfs-api], [3.4.1]) ]) diff --git a/m4/virt-gnutls.m4 b/m4/virt-gnutls.m4 index 1e60f28da2..bd861eec5f 100644 --- a/m4/virt-gnutls.m4 +++ b/m4/virt-gnutls.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_GNUTLS],[ +AC_DEFUN([LIBVIRT_ARG_GNUTLS],[ LIBVIRT_ARG_WITH([GNUTLS], [gnutls], [check], [2.2.0]) +]) + +AC_DEFUN([LIBVIRT_CHECK_GNUTLS],[ LIBVIRT_CHECK_PKG([GNUTLS], [gnutls], [2.2.0]) if test "$with_gnutls" = "yes" ; then diff --git a/m4/virt-hal.m4 b/m4/virt-hal.m4 index 38aa7b2d8d..7ed44881bb 100644 --- a/m4/virt-hal.m4 +++ b/m4/virt-hal.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_HAL],[ +AC_DEFUN([LIBVIRT_ARG_HAL],[ LIBVIRT_ARG_WITH([HAL], [hal], [check], [0.5.0]) +]) + +AC_DEFUN([LIBVIRT_CHECK_HAL],[ LIBVIRT_CHECK_PKG([HAL], [hal], [0.5.0]) ]) diff --git a/m4/virt-host-validate.m4 b/m4/virt-host-validate.m4 index 3aca34deee..0970fa1ed4 100644 --- a/m4/virt-host-validate.m4 +++ b/m4/virt-host-validate.m4 @@ -15,9 +15,11 @@ 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_HOST_VALIDATE], [ +AC_DEFUN([LIBVIRT_ARG_HOST_VALIDATE], [ LIBVIRT_ARG_WITH_ALT([HOST_VALIDATE], [build virt-host-validate], [check]) +]) +AC_DEFUN([LIBVIRT_CHECK_HOST_VALIDATE], [ if test "x$with_host_validate" != "xno"; then if test "x$with_win" = "xyes"; then if test "x$with_host_validate" = "xyes"; then diff --git a/m4/virt-init-script.m4 b/m4/virt-init-script.m4 index 1eb43a9288..cebac93362 100644 --- a/m4/virt-init-script.m4 +++ b/m4/virt-init-script.m4 @@ -17,11 +17,13 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_INIT_SCRIPT],[ +AC_DEFUN([LIBVIRT_ARG_INIT_SCRIPT],[ LIBVIRT_ARG_WITH_ALT([INIT_SCRIPT], [Style of init script to install: redhat, systemd, systemd+redhat, upstart, check, none], [check]) +]) +AC_DEFUN([LIBVIRT_CHECK_INIT_SCRIPT],[ AC_MSG_CHECKING([for init script type]) init_redhat=no diff --git a/m4/virt-libssh.m4 b/m4/virt-libssh.m4 index b5912acae3..4107385b27 100644 --- a/m4/virt-libssh.m4 +++ b/m4/virt-libssh.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_LIBSSH],[ +AC_DEFUN([LIBVIRT_ARG_LIBSSH],[ LIBVIRT_ARG_WITH([LIBSSH], [libssh], [check], [0.7]) +]) + +AC_DEFUN([LIBVIRT_CHECK_LIBSSH],[ LIBVIRT_CHECK_PKG([LIBSSH], [libssh], [0.7]) ]) diff --git a/m4/virt-login-shell.m4 b/m4/virt-login-shell.m4 index a2b90dae6e..c922e376b1 100644 --- a/m4/virt-login-shell.m4 +++ b/m4/virt-login-shell.m4 @@ -15,9 +15,11 @@ 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_DEFUN([LIBVIRT_ARG_LOGIN_SHELL], [ LIBVIRT_ARG_WITH_ALT([LOGIN_SHELL], [build virt-login-shell], [check]) +]) +AC_DEFUN([LIBVIRT_CHECK_LOGIN_SHELL], [ if test "x$with_login_shell" != "xno"; then if test "x$with_linux" != "xyes"; then if test "x$with_login_shell" = "xyes"; then diff --git a/m4/virt-netcf.m4 b/m4/virt-netcf.m4 index eb919afd7c..19374b223b 100644 --- a/m4/virt-netcf.m4 +++ b/m4/virt-netcf.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_NETCF],[ +AC_DEFUN([LIBVIRT_ARG_NETCF],[ LIBVIRT_ARG_WITH([NETCF], [netcf], [check], [0.1.4]) +]) + +AC_DEFUN([LIBVIRT_CHECK_NETCF],[ LIBVIRT_CHECK_PKG([NETCF], [netcf], [0.1.4]) if test "$with_netcf" = "yes" ; then diff --git a/m4/virt-nss.m4 b/m4/virt-nss.m4 index f95010d692..15030cab48 100644 --- a/m4/virt-nss.m4 +++ b/m4/virt-nss.m4 @@ -17,11 +17,13 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_NSS],[ +AC_DEFUN([LIBVIRT_ARG_NSS],[ LIBVIRT_ARG_WITH_ALT([NSS_PLUGIN], [enable Name Service Switch plugin for resolving guest IP addresses], [check]) +]) +AC_DEFUN([LIBVIRT_CHECK_NSS],[ bsd_nss=no fail=0 if test "x$with_nss_plugin" != "xno" ; then diff --git a/m4/virt-numactl.m4 b/m4/virt-numactl.m4 index 6f62c51d5b..7dbb1bb2ac 100644 --- a/m4/virt-numactl.m4 +++ b/m4/virt-numactl.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_NUMACTL],[ +AC_DEFUN([LIBVIRT_ARG_NUMACTL],[ LIBVIRT_ARG_WITH([NUMACTL], [numa], [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_NUMACTL],[ LIBVIRT_CHECK_LIB([NUMACTL], [numa], [numa_available], [numa.h]) AC_CHECK_LIB([numa], [numa_bitmask_isbitset], [have_numa_bitmask_isbitset=yes]) if test "$have_numa_bitmask_isbitset" = "yes"; then diff --git a/m4/virt-openwsman.m4 b/m4/virt-openwsman.m4 index 5f6a4eb047..cd7e9e2ee4 100644 --- a/m4/virt-openwsman.m4 +++ b/m4/virt-openwsman.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_OPENWSMAN],[ +AC_DEFUN([LIBVIRT_ARG_OPENWSMAN],[ LIBVIRT_ARG_WITH([OPENWSMAN], [openwsman], [check], [2.2.3]) +]) + +AC_DEFUN([LIBVIRT_CHECK_OPENWSMAN],[ LIBVIRT_CHECK_PKG([OPENWSMAN], [openwsman], [2.2.3]) ]) diff --git a/m4/virt-pciaccess.m4 b/m4/virt-pciaccess.m4 index 9a29fe9020..d96af8b231 100644 --- a/m4/virt-pciaccess.m4 +++ b/m4/virt-pciaccess.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_PCIACCESS],[ +AC_DEFUN([LIBVIRT_ARG_PCIACCESS],[ LIBVIRT_ARG_WITH([PCIACCESS], [pciaccess], [check], [0.10.0]) +]) + +AC_DEFUN([LIBVIRT_CHECK_PCIACCESS],[ LIBVIRT_CHECK_PKG([PCIACCESS], [pciaccess], [0.10.0]) ]) diff --git a/m4/virt-readline.m4 b/m4/virt-readline.m4 index c1c8fa87cd..e32f5f5332 100644 --- a/m4/virt-readline.m4 +++ b/m4/virt-readline.m4 @@ -17,9 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_READLINE],[ +AC_DEFUN([LIBVIRT_ARG_READLINE],[ LIBVIRT_ARG_WITH([READLINE], [readline], [check]) +]) +AC_DEFUN([LIBVIRT_CHECK_READLINE],[ extra_LIBS= lv_saved_libs=$LIBS if test "x$with_readline" != xno; then diff --git a/m4/virt-sanlock.m4 b/m4/virt-sanlock.m4 index 64f950bd70..97bdf0c71b 100644 --- a/m4/virt-sanlock.m4 +++ b/m4/virt-sanlock.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_SANLOCK],[ +AC_DEFUN([LIBVIRT_ARG_SANLOCK],[ LIBVIRT_ARG_WITH([SANLOCK], [sanlock-client], [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_SANLOCK],[ LIBVIRT_CHECK_LIB([SANLOCK], [sanlock_client], [sanlock_init], [sanlock.h]) if test "x$with_sanlock" = "xyes" ; then diff --git a/m4/virt-sasl.m4 b/m4/virt-sasl.m4 index 9e5fe03867..15b1ce9cdf 100644 --- a/m4/virt-sasl.m4 +++ b/m4/virt-sasl.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_SASL],[ +AC_DEFUN([LIBVIRT_ARG_SASL],[ LIBVIRT_ARG_WITH([SASL], [sasl], [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_SASL],[ LIBVIRT_CHECK_LIB_ALT([SASL], [sasl2], [sasl_client_init], [sasl/sasl.h], [SASL1], [sasl], diff --git a/m4/virt-selinux.m4 b/m4/virt-selinux.m4 index 992066ad2e..2f5b10bc54 100644 --- a/m4/virt-selinux.m4 +++ b/m4/virt-selinux.m4 @@ -17,13 +17,15 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_SELINUX],[ +AC_DEFUN([LIBVIRT_ARG_SELINUX],[ LIBVIRT_ARG_WITH([SELINUX], [SELinux], [check]) + LIBVIRT_ARG_WITH_ALT([SELINUX_MOUNT], [set SELinux mount point], [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_SELINUX],[ LIBVIRT_CHECK_LIB([SELINUX], [selinux], [fgetfilecon_raw], [selinux/selinux.h]) - LIBVIRT_ARG_WITH_ALT([SELINUX_MOUNT], [set SELinux mount point], [check]) - if test "$with_selinux" = "yes"; then # libselinux changed signatures between 2.2 and 2.3 AC_CACHE_CHECK([for selinux setcon parameter type], [lv_cv_setcon_const], diff --git a/m4/virt-ssh2.m4 b/m4/virt-ssh2.m4 index ed3bebbe99..da8ec5aaef 100644 --- a/m4/virt-ssh2.m4 +++ b/m4/virt-ssh2.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_SSH2],[ +AC_DEFUN([LIBVIRT_ARG_SSH2],[ LIBVIRT_ARG_WITH([SSH2], [libssh2], [check], [1.3]) +]) + +AC_DEFUN([LIBVIRT_CHECK_SSH2],[ LIBVIRT_CHECK_PKG([SSH2], [libssh2], [1.3]) ]) diff --git a/m4/virt-udev.m4 b/m4/virt-udev.m4 index 3ac4c40732..363aa983dd 100644 --- a/m4/virt-udev.m4 +++ b/m4/virt-udev.m4 @@ -17,8 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_UDEV],[ +AC_DEFUN([LIBVIRT_ARG_UDEV],[ LIBVIRT_ARG_WITH([UDEV], [libudev], [check], [145]) +]) + +AC_DEFUN([LIBVIRT_CHECK_UDEV],[ AC_REQUIRE([LIBVIRT_CHECK_PCIACCESS]) LIBVIRT_CHECK_PKG([UDEV], [libudev], [145]) diff --git a/m4/virt-wireshark.m4 b/m4/virt-wireshark.m4 index d11bec05b5..f0cd08b550 100644 --- a/m4/virt-wireshark.m4 +++ b/m4/virt-wireshark.m4 @@ -17,13 +17,15 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_WIRESHARK],[ +AC_DEFUN([LIBVIRT_ARG_WIRESHARK],[ LIBVIRT_ARG_WITH([WIRESHARK_DISSECTOR], [wireshark], [check], [1.11.3]) - LIBVIRT_CHECK_PKG([WIRESHARK_DISSECTOR], [wireshark], [1.11.3]) - LIBVIRT_ARG_WITH_ALT([WS_PLUGINDIR], [wireshark plugins directory for use when installing wireshark plugin], [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_WIRESHARK],[ + LIBVIRT_CHECK_PKG([WIRESHARK_DISSECTOR], [wireshark], [1.11.3]) dnl Check for system location of wireshark plugins if test "x$with_wireshark_dissector" != "xno" ; then diff --git a/m4/virt-yajl.m4 b/m4/virt-yajl.m4 index 87271addad..0103f72643 100644 --- a/m4/virt-yajl.m4 +++ b/m4/virt-yajl.m4 @@ -17,9 +17,11 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_CHECK_YAJL],[ +AC_DEFUN([LIBVIRT_ARG_YAJL],[ LIBVIRT_ARG_WITH([YAJL], [yajl], [check]) +]) +AC_DEFUN([LIBVIRT_CHECK_YAJL],[ dnl YAJL JSON library http://lloyd.github.com/yajl/ if test "$with_qemu:$with_yajl" = yes:check; then dnl Some versions of qemu require the use of yajl; try to detect them -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:39 +0100, Pavel Hrdina wrote:
Usage of AC_REQUIRE will mess with order how LIBVIRT_CHECK_* macros are composed into configure.ac. This ensures that the output of configure --help is properly ordered and grouped into sections.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
ACK Jirka

This allows to use two or more LIBVIRT_CHECK_(LIB|LIB_ALT|PKG) macros for one library. For example, when we check for existence of pgk-config file of some library and we know that not all versions of that library that libvirt requires provides this file, we can fallback to use library check. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-lib.m4 | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/m4/virt-lib.m4 b/m4/virt-lib.m4 index 7d7e597b66..b02caf15cc 100644 --- a/m4/virt-lib.m4 +++ b/m4/virt-lib.m4 @@ -24,7 +24,8 @@ dnl config header var, WITH_XXXX make conditional and dnl with_XXX configure shell var. dnl dnl LIBVIRT_CHECK_LIB([CHECK_NAME], [LIBRARY_NAME], -dnl [FUNCTION_NAME], [HEADER_NAME]) +dnl [FUNCTION_NAME], [HEADER_NAME], +dnl [FAIL_ACTION]) dnl dnl CHECK_NAME: Suffix/prefix used for variables / flags, in uppercase. dnl Used to set @@ -37,6 +38,8 @@ dnl dnl LIBRARY_NAME: base name of library to check for eg libXXX.so dnl FUNCTION_NAME: function to check for in libXXX.so dnl HEADER_NAME: header file to check for +dnl FAIL_ACTION: overrides the default fail action +dnl dnl dnl e.g. dnl @@ -52,6 +55,7 @@ AC_DEFUN([LIBVIRT_CHECK_LIB],[ m4_pushdef([library_name], [$2]) m4_pushdef([function_name], [$3]) m4_pushdef([header_name], [$4]) + m4_pushdef([fail_action], [$5]) m4_pushdef([check_name_lc], m4_tolower(check_name)) @@ -96,7 +100,8 @@ AC_DEFUN([LIBVIRT_CHECK_LIB],[ CFLAGS=$old_CFLAGS if test $fail = 1; then - AC_MSG_ERROR([You must install the lib]library_name[ library & headers to compile libvirt]) + m4_default(fail_action, + [AC_MSG_ERROR([You must install the lib]library_name[ library & headers to compile libvirt])]) else if test "x$with_var" = "xyes" ; then if test "x$libs_var" = 'x' ; then @@ -121,6 +126,7 @@ AC_DEFUN([LIBVIRT_CHECK_LIB],[ m4_popdef([check_name_lc]) + m4_popdef([fail_action]) m4_popdef([header_name]) m4_popdef([function_name]) m4_popdef([library_name]) @@ -134,7 +140,8 @@ dnl dnl LIBVIRT_CHECK_LIB_ALT([CHECK_NAME], [LIBRARY_NAME], dnl [FUNCTION_NAME], [HEADER_NAME], dnl [CHECK_NAME_ALT, [LIBRARY_NAME_ALT], -dnl [FUNCTION_NAME_ALT], [HEADER_NAME_ALT]) +dnl [FUNCTION_NAME_ALT], [HEADER_NAME_ALT], +dnl [FAIL_ACTION]) dnl dnl CHECK_NAME: Suffix/prefix used for variables / flags, in uppercase. dnl Used to set @@ -156,6 +163,7 @@ dnl NB all vars for CHECK_NAME are also set dnl LIBRARY_NAME_ALT: alternative library name to check for dnl FUNCTION_NAME_ALT: alternative function name to check for dnl HEADER_NAME_ALT: alternative header file to check for +dnl FAIL_ACTION: overrides the default fail action dnl dnl e.g. dnl @@ -173,6 +181,7 @@ AC_DEFUN([LIBVIRT_CHECK_LIB_ALT],[ m4_pushdef([library_name_alt], [$6]) m4_pushdef([function_name_alt], [$7]) m4_pushdef([header_name_alt], [$8]) + m4_pushdef([fail_action], [$9]) m4_pushdef([check_name_lc], m4_tolower(check_name)) @@ -228,7 +237,8 @@ AC_DEFUN([LIBVIRT_CHECK_LIB_ALT],[ CFLAGS=$old_CFLAGS if test $fail = 1; then - AC_MSG_ERROR([You must install the lib]library_name[ library & headers to compile libvirt]) + m4_default(fail_action, + [AC_MSG_ERROR([You must install the lib]library_name[ library & headers to compile libvirt])]) else if test "x$with_var" = "xyes" ; then if test "x$libs_var" = 'x' ; then @@ -260,6 +270,7 @@ AC_DEFUN([LIBVIRT_CHECK_LIB_ALT],[ m4_popdef([check_name_lc]) + m4_popdef([fail_action]) m4_popdef([header_name_alt]) m4_popdef([function_name_alt]) m4_popdef([library_name_alt]) @@ -274,7 +285,8 @@ dnl Probe for existence of libXXXX and set WITH_XXX dnl config header var, WITH_XXXX make conditional and dnl with_XXX configure shell var. dnl -dnl LIBVIRT_CHECK_PKG([CHECK_NAME], [PC_NAME], [PC_VERSION]) +dnl LIBVIRT_CHECK_PKG([CHECK_NAME], [PC_NAME], [PC_VERSION], +dnl [FAIL_ACTION]) dnl dnl CHECK_NAME: Suffix/prefix used for variables / flags, in uppercase. dnl Used to set @@ -285,6 +297,7 @@ dnl configure: --with-xxx argument dnl configure: with_xxx variable dnl PC_NAME: Name of the pkg-config module dnl PC_VERSION: Version of the pkg-config module +dnl FAIL_ACTION: overrides the default fail action dnl dnl eg dnl @@ -294,6 +307,7 @@ AC_DEFUN([LIBVIRT_CHECK_PKG],[ m4_pushdef([check_name], [$1]) m4_pushdef([pc_name], [$2]) m4_pushdef([pc_version], [$3]) + m4_pushdef([fail_action], [$4]) m4_pushdef([check_name_lc], m4_tolower(check_name)) @@ -316,7 +330,8 @@ AC_DEFUN([LIBVIRT_CHECK_PKG],[ fi if test $fail = 1; then - AC_MSG_ERROR([You must install the ]pc_name[ >= ]pc_version[ pkg-config module to compile libvirt]) + m4_default(fail_action, + [AC_MSG_ERROR([You must install the ]pc_name[ >= ]pc_version[ pkg-config module to compile libvirt])]) fi if test "x$with_var" = "xyes" ; then @@ -333,6 +348,7 @@ AC_DEFUN([LIBVIRT_CHECK_PKG],[ m4_popdef([check_name_lc]) + m4_popdef([fail_action]) m4_popdef([pc_version]) m4_popdef([pc_name]) m4_popdef([check_name]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:40 +0100, Pavel Hrdina wrote:
This allows to use two or more LIBVIRT_CHECK_(LIB|LIB_ALT|PKG) macros for one library. For example, when we check for existence of pgk-config file of some library and we know that not all versions of that library that libvirt requires provides this file, we can fallback to use library check.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 55 +++------------------------------------ m4/virt-libxml.m4 | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 52 deletions(-) create mode 100644 m4/virt-libxml.m4 diff --git a/configure.ac b/configure.ac index a710a4f050..26174cc2e4 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,6 @@ then fi dnl Required minimum versions of all libs we depend on -LIBXML_REQUIRED="2.6.0" POLKIT_REQUIRED="0.6" PARTED_REQUIRED="1.8.0" DEVMAPPER_REQUIRED=1.0.0 @@ -995,56 +994,8 @@ dnl Need to test if pkg-config exists PKG_PROG_PKG_CONFIG -dnl ========================================================================== -dnl find libxml2 library, borrowed from xmlsec -dnl ========================================================================== -LIBXML_CONFIG="xml2-config" -LIBXML_CFLAGS="" -LIBXML_LIBS="" -LIBXML_FOUND="no" - -LIBVIRT_ARG_WITH_ALT([LIBXML], [libxml2 (>= 2.6.0) location], [check]) - -if test "x$with_libxml" = "xno" ; then - AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_REQUIRED) - AC_MSG_ERROR([libxml2 >= $LIBXML_REQUIRED is required for libvirt]) -elif test "x$with_libxml" != "xno" && test "x$PKG_CONFIG" != "x" ; then - PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED, [LIBXML_FOUND=yes], [LIBXML_FOUND=no]) -fi -if test "$LIBXML_FOUND" = "no" ; then - if test "x$with_libxml" != "xyes" ; then - LIBXML_CONFIG=$with_libxml/bin/$LIBXML_CONFIG - fi - AC_MSG_CHECKING(libxml2 $LIBXML_CONFIG >= $LIBXML_REQUIRED ) - if ! $LIBXML_CONFIG --version > /dev/null 2>&1 ; then - AC_MSG_ERROR([Could not find libxml2 anywhere (see config.log for details).]) - fi - vers=`$LIBXML_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - minvers=`echo $LIBXML_REQUIRED | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - if test "$vers" -ge "$minvers" ; then - LIBXML_LIBS="`$LIBXML_CONFIG --libs`" - LIBXML_CFLAGS="`$LIBXML_CONFIG --cflags`" - LIBXML_FOUND="yes" - AC_MSG_RESULT(yes) - else - AC_MSG_ERROR( - [You need at least libxml2 $LIBXML_REQUIRED for this version of libvirt]) - fi -fi - -AC_SUBST([LIBXML_CFLAGS]) -AC_SUBST([LIBXML_LIBS]) - -dnl xmlURI structure has query_raw? -old_CFLAGS="$CFLAGS" -old_LIBS="$LIBS" -CFLAGS="$CFLAGS $LIBXML_CFLAGS" -LIBS="$LIBS $LIBXML_LIBS" -AC_CHECK_MEMBER([struct _xmlURI.query_raw], - [AC_DEFINE([HAVE_XMLURI_QUERY_RAW], [], [Have query_raw field in libxml2 xmlURI structure])],, - [#include <libxml/uri.h>]) -CFLAGS="$old_CFLAGS" -LIBS="$old_LIBS" +LIBVIRT_ARG_LIBXML +LIBVIRT_CHECK_LIBXML LIBVIRT_ARG_WITH_ALT([TLS_PRIORITY], @@ -2456,6 +2407,7 @@ LIBVIRT_RESULT_GLUSTER LIBVIRT_RESULT_GNUTLS LIBVIRT_RESULT_HAL LIBVIRT_RESULT_LIBSSH +LIBVIRT_RESULT_LIBXML LIBVIRT_RESULT_NETCF LIBVIRT_RESULT_NSS LIBVIRT_RESULT_NUMACTL @@ -2468,7 +2420,6 @@ LIBVIRT_RESULT_SELINUX LIBVIRT_RESULT_SSH2 LIBVIRT_RESULT_UDEV LIBVIRT_RESULT_YAJL -AC_MSG_NOTICE([ libxml: $LIBXML_CFLAGS $LIBXML_LIBS]) AC_MSG_NOTICE([ dlopen: $DLOPEN_LIBS]) AC_MSG_NOTICE([firewalld: $with_firewalld]) if test "$with_polkit" = "yes" ; then diff --git a/m4/virt-libxml.m4 b/m4/virt-libxml.m4 new file mode 100644 index 0000000000..8bb092f610 --- /dev/null +++ b/m4/virt-libxml.m4 @@ -0,0 +1,78 @@ +dnl The libxml-2.0 library +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_ARG_LIBXML], [ + LIBVIRT_ARG_WITH_ALT([LIBXML], [libxml-2.0 (>= 2.6.0) location], [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_LIBXML], [ + LIBXML_REQUIRED="2.6.0" + LIBXML_CONFIG="xml2-config" + LIBXML_CFLAGS="" + LIBXML_LIBS="" + LIBXML_FOUND="no" + + if test "x$with_libxml" = "xno" ; then + AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_REQUIRED) + AC_MSG_ERROR([libxml2 >= $LIBXML_REQUIRED is required for libvirt]) + elif test "x$with_libxml" != "xno" && test "x$PKG_CONFIG" != "x" ; then + PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED, [LIBXML_FOUND=yes], [LIBXML_FOUND=no]) + fi + if test "$LIBXML_FOUND" = "no" ; then + if test "x$with_libxml" != "xyes" ; then + LIBXML_CONFIG=$with_libxml/bin/$LIBXML_CONFIG + fi + AC_MSG_CHECKING(libxml2 $LIBXML_CONFIG >= $LIBXML_REQUIRED ) + if ! $LIBXML_CONFIG --version > /dev/null 2>&1 ; then + AC_MSG_ERROR([Could not find libxml2 anywhere (see config.log for details).]) + fi + vers=`$LIBXML_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` + minvers=`echo $LIBXML_REQUIRED | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` + if test "$vers" -ge "$minvers" ; then + LIBXML_LIBS="`$LIBXML_CONFIG --libs`" + LIBXML_CFLAGS="`$LIBXML_CONFIG --cflags`" + LIBXML_FOUND="yes" + AC_MSG_RESULT(yes) + else + AC_MSG_ERROR( + [You need at least libxml2 $LIBXML_REQUIRED for this version of libvirt]) + fi + fi + + AC_SUBST([LIBXML_CFLAGS]) + AC_SUBST([LIBXML_LIBS]) + + dnl xmlURI structure has query_raw? + old_CFLAGS="$CFLAGS" + old_LIBS="$LIBS" + CFLAGS="$CFLAGS $LIBXML_CFLAGS" + LIBS="$LIBS $LIBXML_LIBS" + + AC_CHECK_MEMBER([struct _xmlURI.query_raw], + [AC_DEFINE([HAVE_XMLURI_QUERY_RAW], [1], + [Have query_raw field in libxml2 xmlURI structure])], + [], [#include <libxml/uri.h>]) + + CFLAGS="$old_CFLAGS" + LIBS="$old_LIBS" +]) + +AC_DEFUN([LIBVIRT_RESULT_LIBXML], [ + LIBVIRT_RESULT_LIB([LIBXML]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:41 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 55 +++------------------------------------ m4/virt-libxml.m4 | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 52 deletions(-) create mode 100644 m4/virt-libxml.m4
ACK Jirka

Pkg-config file libxml-2.0.pc was introduced in libxml2-2.2.4 and we require at least 2.6.0 so the crazy xml2-config check can be dropped. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-libxml.m4 | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/m4/virt-libxml.m4 b/m4/virt-libxml.m4 index 8bb092f610..a683f75e69 100644 --- a/m4/virt-libxml.m4 +++ b/m4/virt-libxml.m4 @@ -23,7 +23,6 @@ AC_DEFUN([LIBVIRT_ARG_LIBXML], [ AC_DEFUN([LIBVIRT_CHECK_LIBXML], [ LIBXML_REQUIRED="2.6.0" - LIBXML_CONFIG="xml2-config" LIBXML_CFLAGS="" LIBXML_LIBS="" LIBXML_FOUND="no" @@ -35,24 +34,7 @@ AC_DEFUN([LIBVIRT_CHECK_LIBXML], [ PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED, [LIBXML_FOUND=yes], [LIBXML_FOUND=no]) fi if test "$LIBXML_FOUND" = "no" ; then - if test "x$with_libxml" != "xyes" ; then - LIBXML_CONFIG=$with_libxml/bin/$LIBXML_CONFIG - fi - AC_MSG_CHECKING(libxml2 $LIBXML_CONFIG >= $LIBXML_REQUIRED ) - if ! $LIBXML_CONFIG --version > /dev/null 2>&1 ; then - AC_MSG_ERROR([Could not find libxml2 anywhere (see config.log for details).]) - fi - vers=`$LIBXML_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - minvers=`echo $LIBXML_REQUIRED | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - if test "$vers" -ge "$minvers" ; then - LIBXML_LIBS="`$LIBXML_CONFIG --libs`" - LIBXML_CFLAGS="`$LIBXML_CONFIG --cflags`" - LIBXML_FOUND="yes" - AC_MSG_RESULT(yes) - else - AC_MSG_ERROR( - [You need at least libxml2 $LIBXML_REQUIRED for this version of libvirt]) - fi + AC_MSG_ERROR([libxml2 >= $LIBXML_REQUIRED is required for libvirt]) fi AC_SUBST([LIBXML_CFLAGS]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:42 +0100, Pavel Hrdina wrote:
Pkg-config file libxml-2.0.pc was introduced in libxml2-2.2.4 and we require at least 2.6.0 so the crazy xml2-config check can be dropped.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-libxml.m4 | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-)
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-libxml.m4 | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/m4/virt-libxml.m4 b/m4/virt-libxml.m4 index a683f75e69..6a9d9116fe 100644 --- a/m4/virt-libxml.m4 +++ b/m4/virt-libxml.m4 @@ -23,23 +23,13 @@ AC_DEFUN([LIBVIRT_ARG_LIBXML], [ AC_DEFUN([LIBVIRT_CHECK_LIBXML], [ LIBXML_REQUIRED="2.6.0" - LIBXML_CFLAGS="" - LIBXML_LIBS="" - LIBXML_FOUND="no" - if test "x$with_libxml" = "xno" ; then - AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_REQUIRED) - AC_MSG_ERROR([libxml2 >= $LIBXML_REQUIRED is required for libvirt]) - elif test "x$with_libxml" != "xno" && test "x$PKG_CONFIG" != "x" ; then - PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED, [LIBXML_FOUND=yes], [LIBXML_FOUND=no]) - fi - if test "$LIBXML_FOUND" = "no" ; then + LIBVIRT_CHECK_PKG([LIBXML], [libxml-2.0], [$LIBXML_REQUIRED]) + + if test "$with_libxml" = "no" ; then AC_MSG_ERROR([libxml2 >= $LIBXML_REQUIRED is required for libvirt]) fi - AC_SUBST([LIBXML_CFLAGS]) - AC_SUBST([LIBXML_LIBS]) - dnl xmlURI structure has query_raw? old_CFLAGS="$CFLAGS" old_LIBS="$LIBS" -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:43 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-libxml.m4 | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-)
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 26 ++++---------------------- m4/virt-dlopen.m4 | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 22 deletions(-) create mode 100644 m4/virt-dlopen.m4 diff --git a/configure.ac b/configure.ac index 26174cc2e4..54144777c5 100644 --- a/configure.ac +++ b/configure.ac @@ -597,22 +597,7 @@ dnl dnl check for libdl dnl -dlfcn_found=yes -dlopen_found=yes - -AC_CHECK_HEADER([dlfcn.h],, [dlfcn_found=no]) -AC_SEARCH_LIBS([dlopen], [dl],, [dlopen_found=no]) - -case $ac_cv_search_dlopen:$host_os in - 'none required'* | *:mingw* | *:msvc*) DLOPEN_LIBS= ;; - no*) AC_MSG_ERROR([Unable to find dlopen()]) ;; - *) if test "x$dlfcn_found" != "xyes"; then - AC_MSG_ERROR([Unable to find dlfcn.h]) - fi - DLOPEN_LIBS=$ac_cv_search_dlopen ;; -esac - -AC_SUBST([DLOPEN_LIBS]) +LIBVIRT_CHECK_DLOPEN dnl @@ -1968,7 +1953,7 @@ fi DRIVER_MODULE_CFLAGS= DRIVER_MODULE_LIBS= if test "$with_driver_modules" = "yes" || test "$with_driver_modules" = "check"; then - if test "$dlfcn_found" != "yes" || test "$dlopen_found" != "yes"; then + if test "$with_dlfcn" != "yes" || test "$with_dlopen" != "yes"; then if test "$with_driver_modules" = "yes" ; then AC_MSG_ERROR([You must have dlfcn.h / dlopen() support to build driver modules]) else @@ -1981,10 +1966,7 @@ fi if test "$with_driver_modules" = "yes" ; then DRIVER_MODULE_LDFLAGS="-export-dynamic" - case $ac_cv_search_dlopen in - no*) DRIVER_MODULE_LIBS= ;; - *) DRIVER_MODULE_LIBS=$ac_cv_search_dlopen ;; - esac + DRIVER_MODULE_LIBS="$DLOPEN_LIBS" AC_DEFINE_UNQUOTED([WITH_DRIVER_MODULES], 1, [whether to build drivers as modules]) fi AM_CONDITIONAL([WITH_DRIVER_MODULES], [test "$with_driver_modules" != "no"]) @@ -2402,6 +2384,7 @@ LIBVIRT_RESULT_BLKID LIBVIRT_RESULT_CAPNG LIBVIRT_RESULT_CURL LIBVIRT_RESULT_DBUS +LIBVIRT_RESULT_DLOPEN LIBVIRT_RESULT_FUSE LIBVIRT_RESULT_GLUSTER LIBVIRT_RESULT_GNUTLS @@ -2420,7 +2403,6 @@ LIBVIRT_RESULT_SELINUX LIBVIRT_RESULT_SSH2 LIBVIRT_RESULT_UDEV LIBVIRT_RESULT_YAJL -AC_MSG_NOTICE([ dlopen: $DLOPEN_LIBS]) AC_MSG_NOTICE([firewalld: $with_firewalld]) if test "$with_polkit" = "yes" ; then if test "$with_polkit0" = "yes" ; then diff --git a/m4/virt-dlopen.m4 b/m4/virt-dlopen.m4 new file mode 100644 index 0000000000..412ce79ade --- /dev/null +++ b/m4/virt-dlopen.m4 @@ -0,0 +1,45 @@ +dnl The dlopen library +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_DLOPEN], [ + + with_dlopen=yes + with_dlfcn=yes + + AC_CHECK_HEADER([dlfcn.h],, [with_dlfcn=no]) + AC_SEARCH_LIBS([dlopen], [dl],, [with_dlopen=no]) + + case $ac_cv_search_dlopen:$host_os in + 'none required'* | *:mingw* | *:msvc*) + DLOPEN_LIBS= ;; + no*) + AC_MSG_ERROR([Unable to find dlopen()]) ;; + *) + if test "x$with_dlfcn" != "xyes"; then + AC_MSG_ERROR([Unable to find dlfcn.h]) + fi + DLOPEN_LIBS=$ac_cv_search_dlopen ;; + esac + + AC_SUBST([DLOPEN_LIBS]) +]) + +AC_DEFUN([LIBVIRT_RESULT_DLOPEN], [ + LIBVIRT_RESULT_LIB([DLOPEN]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:44 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 26 ++++---------------------- m4/virt-dlopen.m4 | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 22 deletions(-) create mode 100644 m4/virt-dlopen.m4
ACK Jirka

Rename DRIVER_MODULE_(LDFLAGS|LIBS|CFLAGS) to unify the naming. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 39 ++++--------------------------- m4/virt-driver-modules.m4 | 58 +++++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 2 +- 3 files changed, 63 insertions(+), 36 deletions(-) create mode 100644 m4/virt-driver-modules.m4 diff --git a/configure.ac b/configure.ac index 54144777c5..7677a25dad 100644 --- a/configure.ac +++ b/configure.ac @@ -1942,36 +1942,9 @@ esac AM_CONDITIONAL([WITH_WIN_ICON], [test "$WINDRES" != ""]) -dnl Driver-Modules library -LIBVIRT_ARG_WITH_ALT([DRIVER_MODULES], [build drivers as loadable modules], - [check]) - -if test "$with_libvirtd" = "no" ; then - with_driver_modules=no -fi - -DRIVER_MODULE_CFLAGS= -DRIVER_MODULE_LIBS= -if test "$with_driver_modules" = "yes" || test "$with_driver_modules" = "check"; then - if test "$with_dlfcn" != "yes" || test "$with_dlopen" != "yes"; then - if test "$with_driver_modules" = "yes" ; then - AC_MSG_ERROR([You must have dlfcn.h / dlopen() support to build driver modules]) - else - with_driver_modules=no - fi - else - with_driver_modules=yes - fi -fi - -if test "$with_driver_modules" = "yes" ; then - DRIVER_MODULE_LDFLAGS="-export-dynamic" - DRIVER_MODULE_LIBS="$DLOPEN_LIBS" - AC_DEFINE_UNQUOTED([WITH_DRIVER_MODULES], 1, [whether to build drivers as modules]) -fi -AM_CONDITIONAL([WITH_DRIVER_MODULES], [test "$with_driver_modules" != "no"]) -AC_SUBST([DRIVER_MODULE_LDFLAGS]) -AC_SUBST([DRIVER_MODULE_LIBS]) +dnl Driver-Modules library support +LIBVIRT_ARG_DRIVER_MODULES +LIBVIRT_CHECK_DRIVER_MODULES # Set LV_LIBTOOL_OBJDIR to "." or $lt_cv_objdir, depending on whether @@ -2368,11 +2341,7 @@ AC_MSG_NOTICE([AppArmor: $with_secdriver_apparmor (install profiles: $with_appar AC_MSG_NOTICE([]) AC_MSG_NOTICE([Driver Loadable Modules]) AC_MSG_NOTICE([]) -if test "$with_driver_modules" != "no" ; then -AC_MSG_NOTICE([ dlopen: $DRIVER_MODULE_CFLAGS $DRIVER_MODULE_LIBS]) -else -AC_MSG_NOTICE([ dlopen: no]) -fi +LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) diff --git a/m4/virt-driver-modules.m4 b/m4/virt-driver-modules.m4 new file mode 100644 index 0000000000..d2f6668176 --- /dev/null +++ b/m4/virt-driver-modules.m4 @@ -0,0 +1,58 @@ +dnl The driver module support +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_ARG_DRIVER_MODULES], [ + LIBVIRT_ARG_WITH_ALT([DRIVER_MODULES], [build drivers as loadable modules], + [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_DRIVER_MODULES], [ + AC_REQUIRE([LIBVIRT_CHECK_DLOPEN]) + + if test "$with_libvirtd" = "no" ; then + with_driver_modules=no + fi + + DRIVER_MODULES_CFLAGS= + DRIVER_MODULES_LIBS= + if test "$with_driver_modules" = "yes" || test "$with_driver_modules" = "check"; then + if test "$with_dlfcn" != "yes" || test "$with_dlopen" != "yes"; then + if test "$with_driver_modules" = "yes" ; then + AC_MSG_ERROR([You must have dlfcn.h / dlopen() support to build driver modules]) + else + with_driver_modules=no + fi + else + with_driver_modules=yes + fi + fi + + if test "$with_driver_modules" = "yes" ; then + DRIVER_MODULES_LDFLAGS="-export-dynamic" + DRIVER_MODULES_LIBS="$DLOPEN_LIBS" + AC_DEFINE_UNQUOTED([WITH_DRIVER_MODULES], 1, [whether to build drivers as modules]) + fi + AM_CONDITIONAL([WITH_DRIVER_MODULES], [test "$with_driver_modules" != "no"]) + AC_SUBST([DRIVER_MODULES_LDFLAGS]) + AC_SUBST([DRIVER_MODULES_LIBS]) +]) + +AC_DEFUN([LIBVIRT_RESULT_DRIVER_MODULES], [ + LIBVIRT_RESULT_LIB([DRIVER_MODULES]) +]) diff --git a/src/Makefile.am b/src/Makefile.am index b713787288..49abcf25d2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -42,7 +42,7 @@ AM_CFLAGS = $(LIBXML_CFLAGS) \ $(LOCK_CHECKING_CFLAGS) \ $(WIN32_EXTRA_CFLAGS) \ $(COVERAGE_CFLAGS) -AM_LDFLAGS = $(DRIVER_MODULE_LDFLAGS) \ +AM_LDFLAGS = $(DRIVER_MODULES_LDFLAGS) \ $(COVERAGE_LDFLAGS) \ $(RELRO_LDFLAGS) \ $(NO_INDIRECT_LDFLAGS) \ -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:45 +0100, Pavel Hrdina wrote:
Rename DRIVER_MODULE_(LDFLAGS|LIBS|CFLAGS) to unify the naming.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 39 ++++--------------------------- m4/virt-driver-modules.m4 | 58 +++++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 2 +- 3 files changed, 63 insertions(+), 36 deletions(-) create mode 100644 m4/virt-driver-modules.m4 ... diff --git a/src/Makefile.am b/src/Makefile.am index b713787288..49abcf25d2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -42,7 +42,7 @@ AM_CFLAGS = $(LIBXML_CFLAGS) \ $(LOCK_CHECKING_CFLAGS) \ $(WIN32_EXTRA_CFLAGS) \ $(COVERAGE_CFLAGS) -AM_LDFLAGS = $(DRIVER_MODULE_LDFLAGS) \ +AM_LDFLAGS = $(DRIVER_MODULES_LDFLAGS) \ $(COVERAGE_LDFLAGS) \ $(RELRO_LDFLAGS) \ $(NO_INDIRECT_LDFLAGS) \
You forgot to change DRIVER_MODULE_LIBS in libvirt_la_LIBADD += \ $(DRIVER_MODULE_LIBS) \ $(CYGWIN_EXTRA_LIBADD) ACK with this fix. Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 17 +++-------------- m4/virt-firewalld.m4 | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 14 deletions(-) create mode 100644 m4/virt-firewalld.m4 diff --git a/configure.ac b/configure.ac index 7677a25dad..75a1a0c030 100644 --- a/configure.ac +++ b/configure.ac @@ -1062,19 +1062,8 @@ AM_CONDITIONAL([WITH_POLKIT1], [test "x$with_polkit1" = "xyes"]) AC_SUBST([POLKIT_CFLAGS]) AC_SUBST([POLKIT_LIBS]) -dnl firewalld -LIBVIRT_ARG_WITH([FIREWALLD], [firewalld], [check]) - -if test "x$with_firewalld" = "xcheck" ; then - with_firewalld=$with_dbus -fi -if test "x$with_firewalld" = "xyes" ; then - if test "x$with_dbus" != "xyes" ; then - AC_MSG_ERROR([You must have dbus enabled for firewalld support]) - fi - AC_DEFINE_UNQUOTED([HAVE_FIREWALLD], [1], [whether firewalld support is enabled]) -fi -AM_CONDITIONAL([HAVE_FIREWALLD], [test "x$with_firewalld" != "xno"]) +LIBVIRT_ARG_FIREWALLD +LIBVIRT_CHECK_FIREWALLD dnl UUCP style file locks for character devices @@ -2354,6 +2343,7 @@ LIBVIRT_RESULT_CAPNG LIBVIRT_RESULT_CURL LIBVIRT_RESULT_DBUS LIBVIRT_RESULT_DLOPEN +LIBVIRT_RESULT_FIREWALLD LIBVIRT_RESULT_FUSE LIBVIRT_RESULT_GLUSTER LIBVIRT_RESULT_GNUTLS @@ -2372,7 +2362,6 @@ LIBVIRT_RESULT_SELINUX LIBVIRT_RESULT_SSH2 LIBVIRT_RESULT_UDEV LIBVIRT_RESULT_YAJL -AC_MSG_NOTICE([firewalld: $with_firewalld]) if test "$with_polkit" = "yes" ; then if test "$with_polkit0" = "yes" ; then AC_MSG_NOTICE([ polkit: $POLKIT_CFLAGS $POLKIT_LIBS (version 0)]) diff --git a/m4/virt-firewalld.m4 b/m4/virt-firewalld.m4 new file mode 100644 index 0000000000..f0283049b5 --- /dev/null +++ b/m4/virt-firewalld.m4 @@ -0,0 +1,43 @@ +dnl The firewalld support +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_ARG_FIREWALLD], [ + LIBVIRT_ARG_WITH([FIREWALLD], [firewalld], [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_FIREWALLD], [ + AC_REQUIRE([LIBVIRT_CHECK_DBUS]) + + if test "x$with_firewalld" = "xcheck" ; then + with_firewalld=$with_dbus + fi + + if test "x$with_firewalld" = "xyes" ; then + if test "x$with_dbus" != "xyes" ; then + AC_MSG_ERROR([You must have dbus enabled for firewalld support]) + fi + AC_DEFINE_UNQUOTED([HAVE_FIREWALLD], [1], [whether firewalld support is enabled]) + fi + + AM_CONDITIONAL([HAVE_FIREWALLD], [test "x$with_firewalld" != "xno"]) +]) + +AC_DEFUN([LIBVIRT_RESULT_FIREWALLD], [ + LIBVIRT_RESULT_LIB([FIREWALLD]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:46 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 17 +++-------------- m4/virt-firewalld.m4 | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 14 deletions(-) create mode 100644 m4/virt-firewalld.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 83 ++---------------------------------------- m4/virt-polkit.m4 | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+), 80 deletions(-) create mode 100644 m4/virt-polkit.m4 diff --git a/configure.ac b/configure.ac index 75a1a0c030..6667a00282 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,6 @@ then fi dnl Required minimum versions of all libs we depend on -POLKIT_REQUIRED="0.6" PARTED_REQUIRED="1.8.0" DEVMAPPER_REQUIRED=1.0.0 LIBPCAP_REQUIRED="1.0.0" @@ -991,76 +990,8 @@ AC_DEFINE_UNQUOTED([TLS_PRIORITY], ["$with_tls_priority"], [TLS default priority string]) -dnl PolicyKit library -POLKIT_CFLAGS= -POLKIT_LIBS= -PKCHECK_PATH= -LIBVIRT_ARG_WITH_ALT([POLKIT], [use PolicyKit for UNIX socket access checks], - [check]) - -with_polkit0=no -with_polkit1=no -if test "x$with_polkit" = "xyes" || test "x$with_polkit" = "xcheck"; then - dnl Check for new polkit first. We directly talk over DBus - dnl but we use existence of pkcheck binary as a sign that - dnl we should prefer polkit-1 over polkit-0, so we check - dnl for it even though we don't ultimately use it - AC_PATH_PROG([PKCHECK_PATH],[pkcheck], [], [$LIBVIRT_SBIN_PATH]) - if test "x$PKCHECK_PATH" != "x" ; then - dnl Found pkcheck, so ensure dbus-devel is present - if test "x$with_dbus" = "xyes" ; then - AC_DEFINE_UNQUOTED([WITH_POLKIT], 1, - [use PolicyKit for UNIX socket access checks]) - AC_DEFINE_UNQUOTED([WITH_POLKIT1], 1, - [use PolicyKit for UNIX socket access checks]) - with_polkit="yes" - with_polkit1="yes" - else - if test "x$with_polkit" = "xcheck" ; then - with_polkit=no - else - AC_MSG_ERROR( - [You must install dbus to compile libvirt with polkit-1]) - fi - fi - else - dnl Check for old polkit second - library + binary - PKG_CHECK_MODULES(POLKIT, polkit-dbus >= $POLKIT_REQUIRED, - [with_polkit=yes], [ - if test "x$with_polkit" = "xcheck" ; then - with_polkit=no - else - AC_MSG_ERROR( - [You must install PolicyKit >= $POLKIT_REQUIRED to compile libvirt]) - fi - ]) - if test "x$with_polkit" = "xyes" ; then - AC_DEFINE_UNQUOTED([WITH_POLKIT], 1, - [use PolicyKit for UNIX socket access checks]) - AC_DEFINE_UNQUOTED([WITH_POLKIT0], 1, - [use PolicyKit for UNIX socket access checks]) - - old_CFLAGS=$CFLAGS - old_LIBS=$LIBS - CFLAGS="$CFLAGS $POLKIT_CFLAGS" - LIBS="$LIBS $POLKIT_LIBS" - AC_CHECK_FUNCS([polkit_context_is_caller_authorized]) - CFLAGS="$old_CFLAGS" - LIBS="$old_LIBS" - - AC_PATH_PROG([POLKIT_AUTH], [polkit-auth]) - if test "x$POLKIT_AUTH" != "x"; then - AC_DEFINE_UNQUOTED([POLKIT_AUTH],["$POLKIT_AUTH"],[Location of polkit-auth program]) - fi - with_polkit0="yes" - fi - fi -fi -AM_CONDITIONAL([WITH_POLKIT], [test "x$with_polkit" = "xyes"]) -AM_CONDITIONAL([WITH_POLKIT0], [test "x$with_polkit0" = "xyes"]) -AM_CONDITIONAL([WITH_POLKIT1], [test "x$with_polkit1" = "xyes"]) -AC_SUBST([POLKIT_CFLAGS]) -AC_SUBST([POLKIT_LIBS]) +LIBVIRT_ARG_POLKIT +LIBVIRT_CHECK_POLKIT LIBVIRT_ARG_FIREWALLD LIBVIRT_CHECK_FIREWALLD @@ -2355,6 +2286,7 @@ LIBVIRT_RESULT_NSS LIBVIRT_RESULT_NUMACTL LIBVIRT_RESULT_OPENWSMAN LIBVIRT_RESULT_PCIACCESS +LIBVIRT_RESULT_POLKIT LIBVIRT_RESULT_READLINE LIBVIRT_RESULT_SANLOCK LIBVIRT_RESULT_SASL @@ -2362,15 +2294,6 @@ LIBVIRT_RESULT_SELINUX LIBVIRT_RESULT_SSH2 LIBVIRT_RESULT_UDEV LIBVIRT_RESULT_YAJL -if test "$with_polkit" = "yes" ; then -if test "$with_polkit0" = "yes" ; then -AC_MSG_NOTICE([ polkit: $POLKIT_CFLAGS $POLKIT_LIBS (version 0)]) -else -AC_MSG_NOTICE([ polkit: $PKCHECK_PATH (version 1)]) -fi -else -AC_MSG_NOTICE([ polkit: no]) -fi if test "$with_xen" = "yes" ; then AC_MSG_NOTICE([ xen: $XEN_CFLAGS $XEN_LIBS]) else diff --git a/m4/virt-polkit.m4 b/m4/virt-polkit.m4 new file mode 100644 index 0000000000..206fc4a39d --- /dev/null +++ b/m4/virt-polkit.m4 @@ -0,0 +1,107 @@ +dnl The polkit library +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_ARG_POLKIT], [ + LIBVIRT_ARG_WITH_ALT([POLKIT], [use PolicyKit for UNIX socket access checks], + [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_POLKIT], [ + AC_REQUIRE([LIBVIRT_CHECK_DBUS]) + + POLKIT_REQUIRED="0.6" + POLKIT_CFLAGS= + POLKIT_LIBS= + PKCHECK_PATH= + + with_polkit0=no + with_polkit1=no + + if test "x$with_polkit" = "xyes" || test "x$with_polkit" = "xcheck"; then + dnl Check for new polkit first. We directly talk over DBus + dnl but we use existence of pkcheck binary as a sign that + dnl we should prefer polkit-1 over polkit-0, so we check + dnl for it even though we don't ultimately use it + AC_PATH_PROG([PKCHECK_PATH], [pkcheck], [], [/usr/sbin:$PATH]) + if test "x$PKCHECK_PATH" != "x" ; then + dnl Found pkcheck, so ensure dbus-devel is present + if test "x$with_dbus" = "xyes" ; then + AC_DEFINE_UNQUOTED([WITH_POLKIT], 1, + [use PolicyKit for UNIX socket access checks]) + AC_DEFINE_UNQUOTED([WITH_POLKIT1], 1, + [use PolicyKit for UNIX socket access checks]) + with_polkit="yes" + with_polkit1="yes" + else + if test "x$with_polkit" = "xcheck" ; then + with_polkit=no + else + AC_MSG_ERROR( + [You must install dbus to compile libvirt with polkit-1]) + fi + fi + else + dnl Check for old polkit second - library + binary + PKG_CHECK_MODULES(POLKIT, polkit-dbus >= $POLKIT_REQUIRED, + [with_polkit=yes], [ + if test "x$with_polkit" = "xcheck" ; then + with_polkit=no + else + AC_MSG_ERROR( + [You must install PolicyKit >= $POLKIT_REQUIRED to compile libvirt]) + fi + ]) + if test "x$with_polkit" = "xyes" ; then + AC_DEFINE_UNQUOTED([WITH_POLKIT], 1, + [use PolicyKit for UNIX socket access checks]) + AC_DEFINE_UNQUOTED([WITH_POLKIT0], 1, + [use PolicyKit for UNIX socket access checks]) + + old_CFLAGS=$CFLAGS + old_LIBS=$LIBS + CFLAGS="$CFLAGS $POLKIT_CFLAGS" + LIBS="$LIBS $POLKIT_LIBS" + AC_CHECK_FUNCS([polkit_context_is_caller_authorized]) + CFLAGS="$old_CFLAGS" + LIBS="$old_LIBS" + + AC_PATH_PROG([POLKIT_AUTH], [polkit-auth]) + if test "x$POLKIT_AUTH" != "x"; then + AC_DEFINE_UNQUOTED([POLKIT_AUTH],["$POLKIT_AUTH"],[Location of polkit-auth program]) + fi + with_polkit0="yes" + fi + fi + fi + + AM_CONDITIONAL([WITH_POLKIT], [test "x$with_polkit" = "xyes"]) + AM_CONDITIONAL([WITH_POLKIT0], [test "x$with_polkit0" = "xyes"]) + AM_CONDITIONAL([WITH_POLKIT1], [test "x$with_polkit1" = "xyes"]) + AC_SUBST([POLKIT_CFLAGS]) + AC_SUBST([POLKIT_LIBS]) +]) + +AC_DEFUN([LIBVIRT_RESULT_POLKIT], [ + if test "$with_polkit0" = "yes" ; then + msg="$POLKIT_CFLAGS $POLKIT_LIBS (version 0)" + else + msg="$PKCHECK_PATH (version 1)" + fi + LIBVIRT_RESULT([polkit], [$with_polkit], [$msg]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:47 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 83 ++---------------------------------------- m4/virt-polkit.m4 | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+), 80 deletions(-) create mode 100644 m4/virt-polkit.m4 ... diff --git a/m4/virt-polkit.m4 b/m4/virt-polkit.m4 new file mode 100644 index 0000000000..206fc4a39d --- /dev/null +++ b/m4/virt-polkit.m4 @@ -0,0 +1,107 @@ +AC_DEFUN([LIBVIRT_CHECK_POLKIT], [ + AC_REQUIRE([LIBVIRT_CHECK_DBUS]) + + POLKIT_REQUIRED="0.6" + POLKIT_CFLAGS= + POLKIT_LIBS= + PKCHECK_PATH= + + with_polkit0=no + with_polkit1=no + + if test "x$with_polkit" = "xyes" || test "x$with_polkit" = "xcheck"; then + dnl Check for new polkit first. We directly talk over DBus + dnl but we use existence of pkcheck binary as a sign that + dnl we should prefer polkit-1 over polkit-0, so we check + dnl for it even though we don't ultimately use it + AC_PATH_PROG([PKCHECK_PATH], [pkcheck], [], [/usr/sbin:$PATH])
The original code used $LIBVIRT_SBIN_PATH which is set to $PATH:/sbin:/usr/sbin:/usr/local/sbin while here you use /usr/sbin:$PATH. Was it intentional? I believe it wasn't since other code you moved (m4/virt-external-programs.m4 still uses $LIBVIRT_SBIN_PATH). ACK if you fix this. Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 35 +--------------------------------- m4/virt-pthread.m4 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 34 deletions(-) create mode 100644 m4/virt-pthread.m4 diff --git a/configure.ac b/configure.ac index 6667a00282..9e43b52650 100644 --- a/configure.ac +++ b/configure.ac @@ -293,40 +293,7 @@ AC_CHECK_FUNCS_ONCE([cfmakeraw fallocate geteuid getgid getgrnam_r \ posix_memalign prlimit regexec sched_getaffinity setgroups setns \ setrlimit symlink sysctlbyname getifaddrs sched_setscheduler unshare]) -dnl Availability of pthread functions. Because of $LIB_PTHREAD, we -dnl cannot use AC_CHECK_FUNCS_ONCE. LIB_PTHREAD and LIBMULTITHREAD -dnl were set during gl_INIT by gnulib. -old_LIBS=$LIBS -LIBS="$LIBS $LIB_PTHREAD $LIBMULTITHREAD" - -pthread_found=yes -AC_CHECK_FUNCS([pthread_mutexattr_init]) -AC_CHECK_HEADER([pthread.h],,[pthread_found=no]) - -if test "$ac_cv_func_pthread_mutexattr_init:$pthread_found" != "yes:yes" -then - AC_MSG_ERROR([A pthreads impl is required for building libvirt]) -fi - -dnl At least mingw64-winpthreads #defines pthread_sigmask to 0, -dnl which in turn causes compilation to complain about unused variables. -dnl Expose this broken implementation, so we can work around it. -AC_CACHE_CHECK([whether pthread_sigmask does anything], - [lv_cv_pthread_sigmask_works], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include <sys/types.h> - #include <signal.h> - ]], [[ - #ifdef pthread_sigmask - int (*foo)(int, const sigset_t *, sigset_t *) = &pthread_sigmask; - return !foo; - #endif - ]])], [lv_cv_pthread_sigmask_works=yes], [lv_cv_pthread_sigmask_works=no])]) -if test "x$lv_cv_pthread_sigmask_works" != xyes; then - AC_DEFINE([FUNC_PTHREAD_SIGMASK_BROKEN], [1], - [Define to 1 if pthread_sigmask is not a real function]) -fi -LIBS=$old_LIBS +LIBVIRT_CHECK_PTHREAD dnl Availability of various common headers (non-fatal if missing). AC_CHECK_HEADERS([pwd.h regex.h sys/un.h \ diff --git a/m4/virt-pthread.m4 b/m4/virt-pthread.m4 new file mode 100644 index 0000000000..5b3750e8e9 --- /dev/null +++ b/m4/virt-pthread.m4 @@ -0,0 +1,56 @@ +dnl The libpthread.so library +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_PTHREAD], [ + old_LIBS="$LIBS" + + dnl Availability of pthread functions. Because of $LIB_PTHREAD, we + dnl cannot use AC_CHECK_FUNCS_ONCE. LIB_PTHREAD and LIBMULTITHREAD + dnl were set during gl_INIT by gnulib. + LIBS="$LIBS $LIB_PTHREAD $LIBMULTITHREAD" + pthread_found=yes + AC_CHECK_FUNCS([pthread_mutexattr_init]) + AC_CHECK_HEADER([pthread.h],,[pthread_found=no]) + + if test "$ac_cv_func_pthread_mutexattr_init:$pthread_found" != "yes:yes" + then + AC_MSG_ERROR([A pthreads impl is required for building libvirt]) + fi + + dnl At least mingw64-winpthreads #defines pthread_sigmask to 0, + dnl which in turn causes compilation to complain about unused variables. + dnl Expose this broken implementation, so we can work around it. + AC_CACHE_CHECK([whether pthread_sigmask does anything], + [lv_cv_pthread_sigmask_works], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include <sys/types.h> + #include <signal.h> + ]], [[ + #ifdef pthread_sigmask + int (*foo)(int, const sigset_t *, sigset_t *) = &pthread_sigmask; + return !foo; + #endif + ]])], [lv_cv_pthread_sigmask_works=yes], [lv_cv_pthread_sigmask_works=no])]) + if test "x$lv_cv_pthread_sigmask_works" != xyes; then + AC_DEFINE([FUNC_PTHREAD_SIGMASK_BROKEN], [1], + [Define to 1 if pthread_sigmask is not a real function]) + fi + + LIBS="$old_LIBS" +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:48 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 35 +--------------------------------- m4/virt-pthread.m4 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 34 deletions(-) create mode 100644 m4/virt-pthread.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 55 +-------------------------------------- m4/virt-atomic.m4 | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 54 deletions(-) create mode 100644 m4/virt-atomic.m4 diff --git a/configure.ac b/configure.ac index 9e43b52650..57f7728c63 100644 --- a/configure.ac +++ b/configure.ac @@ -312,60 +312,7 @@ fi AC_SUBST([ACL_CFLAGS]) AC_SUBST([ACL_LIBS]) -dnl We need to decide at configure time if libvirt will use real atomic -dnl operations ("lock free") or emulated ones with a mutex. - -dnl Note that the atomic ops are only available with GCC on x86 when -dnl using -march=i486 or higher. If we detect that the atomic ops are -dnl not available but would be available given the right flags, we want -dnl to abort and advise the user to fix their CFLAGS. It's better to do -dnl that then to silently fall back on emulated atomic ops just because -dnl the user had the wrong build environment. - -atomic_ops= - -AC_MSG_CHECKING([for atomic ops implementation]) - -AC_TRY_COMPILE([], [__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4;],[ - atomic_ops=gcc -],[]) - -if test "$atomic_ops" = "" ; then - SAVE_CFLAGS="${CFLAGS}" - CFLAGS="-march=i486" - AC_TRY_COMPILE([], - [__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4;], - [AC_MSG_ERROR([Libvirt must be built with -march=i486 or later.])], - []) - CFLAGS="${SAVE_CFLAGS}" - - case "$host" in - *-*-mingw* | *-*-msvc* ) - atomic_ops=win32 - ;; - *) - if test "$ac_cv_header_pthread_h" = "yes" ; then - atomic_ops=pthread - else - AC_MSG_ERROR([Libvirt must be built with GCC or have pthread.h on non-Win32 platforms]) - fi - ;; - esac -fi - -case "$atomic_ops" in - gcc) - AC_DEFINE([VIR_ATOMIC_OPS_GCC],[1],[Use GCC atomic ops]) - ;; - win32) - AC_DEFINE([VIR_ATOMIC_OPS_WIN32],[1],[Use Win32 atomic ops]) - ;; - pthread) - AC_DEFINE([VIR_ATOMIC_OPS_PTHREAD],[1],[Use pthread atomic ops emulation]) - ;; -esac -AM_CONDITIONAL([WITH_ATOMIC_OPS_PTHREAD],[test "$atomic_ops" = "pthread"]) -AC_MSG_RESULT([$atomic_ops]) +LIBVIRT_CHECK_ATOMIC AC_CHECK_TYPE([struct ifreq], diff --git a/m4/virt-atomic.m4 b/m4/virt-atomic.m4 new file mode 100644 index 0000000000..d96f7a2bac --- /dev/null +++ b/m4/virt-atomic.m4 @@ -0,0 +1,77 @@ +dnl The atomic implementation check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_ATOMIC], [ + AC_REQUIRE([LIBVIRT_CHECK_PTHREAD]) + + dnl We need to decide at configure time if libvirt will use real atomic + dnl operations ("lock free") or emulated ones with a mutex. + dnl + dnl Note that the atomic ops are only available with GCC on x86 when + dnl using -march=i486 or higher. If we detect that the atomic ops are + dnl not available but would be available given the right flags, we want + dnl to abort and advise the user to fix their CFLAGS. It's better to do + dnl that then to silently fall back on emulated atomic ops just because + dnl the user had the wrong build environment. + + atomic_ops= + + AC_MSG_CHECKING([for atomic ops implementation]) + + AC_TRY_COMPILE([], [__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4;],[ + atomic_ops=gcc + ],[]) + + if test "$atomic_ops" = "" ; then + SAVE_CFLAGS="${CFLAGS}" + CFLAGS="-march=i486" + AC_TRY_COMPILE([], + [__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4;], + [AC_MSG_ERROR([Libvirt must be built with -march=i486 or later.])], + []) + CFLAGS="${SAVE_CFLAGS}" + + case "$host" in + *-*-mingw* | *-*-msvc* ) + atomic_ops=win32 + ;; + *) + if test "$ac_cv_header_pthread_h" = "yes" ; then + atomic_ops=pthread + else + AC_MSG_ERROR([Libvirt must be built with GCC or have pthread.h on non-Win32 platforms]) + fi + ;; + esac + fi + + case "$atomic_ops" in + gcc) + AC_DEFINE([VIR_ATOMIC_OPS_GCC],[1],[Use GCC atomic ops]) + ;; + win32) + AC_DEFINE([VIR_ATOMIC_OPS_WIN32],[1],[Use Win32 atomic ops]) + ;; + pthread) + AC_DEFINE([VIR_ATOMIC_OPS_PTHREAD],[1],[Use pthread atomic ops emulation]) + ;; + esac + AM_CONDITIONAL([WITH_ATOMIC_OPS_PTHREAD],[test "$atomic_ops" = "pthread"]) + AC_MSG_RESULT([$atomic_ops]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:49 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 55 +-------------------------------------- m4/virt-atomic.m4 | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 54 deletions(-) create mode 100644 m4/virt-atomic.m4
ACK if you fix the "onw" typo in the subject :-) Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 40 ++------------------------------------- m4/virt-xdr.m4 | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 38 deletions(-) create mode 100644 m4/virt-xdr.m4 diff --git a/configure.ac b/configure.ac index 57f7728c63..e80528d211 100644 --- a/configure.ac +++ b/configure.ac @@ -471,39 +471,7 @@ dnl dnl check for XDR dnl -if test x"$with_remote" = x"yes" || test x"$with_libvirtd" = x"yes"; then - dnl Where are the XDR functions? - dnl If portablexdr is installed, prefer that. - dnl Otherwise try -lrpc (Cygwin) -lxdr (some MinGW), -lnsl (Solaris) - dnl -ltirpc (glibc 2.13.90 or newer) or none (most Unix) - AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[ - AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl tirpc],[], - [AC_MSG_ERROR([Cannot find a XDR library])]) - ]) - - dnl check for cygwin's variation in xdr function names - AC_CHECK_FUNCS([xdr_u_int64_t],[],[],[#include <rpc/xdr.h>]) - - dnl Cygwin/recent glibc requires -I/usr/include/tirpc for <rpc/rpc.h> - old_CFLAGS=$CFLAGS - AC_CACHE_CHECK([where to find <rpc/rpc.h>], [lv_cv_xdr_cflags], [ - for add_CFLAGS in '' '-I/usr/include/tirpc' 'missing'; do - if test x"$add_CFLAGS" = xmissing; then - lv_cv_xdr_cflags=missing; break - fi - CFLAGS="$old_CFLAGS $add_CFLAGS" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <rpc/rpc.h> - ]])], [lv_cv_xdr_cflags=${add_CFLAGS:-none}; break]) - done - ]) - CFLAGS=$old_CFLAGS - case $lv_cv_xdr_cflags in - none) XDR_CFLAGS= ;; - missing) AC_MSG_ERROR([Unable to find <rpc/rpc.h>]) ;; - *) XDR_CFLAGS=$lv_cv_xdr_cflags ;; - esac - AC_SUBST([XDR_CFLAGS]) -fi +LIBVIRT_CHECK_XDR dnl @@ -2207,6 +2175,7 @@ LIBVIRT_RESULT_SASL LIBVIRT_RESULT_SELINUX LIBVIRT_RESULT_SSH2 LIBVIRT_RESULT_UDEV +LIBVIRT_RESULT_XDR LIBVIRT_RESULT_YAJL if test "$with_xen" = "yes" ; then AC_MSG_NOTICE([ xen: $XEN_CFLAGS $XEN_LIBS]) @@ -2238,11 +2207,6 @@ AC_MSG_NOTICE([ mscom: $MSCOM_LIBS]) else AC_MSG_NOTICE([ mscom: no]) fi -if test "$with_remote" = "yes" || test "$with_libvirtd" = "yes" ; then -AC_MSG_NOTICE([ xdr: $XDR_CFLAGS]) -else -AC_MSG_NOTICE([ xdr: no]) -fi if test "$with_storage_rbd" = "yes" ; then AC_MSG_NOTICE([ rbd: $LIBRBD_LIBS]) else diff --git a/m4/virt-xdr.m4 b/m4/virt-xdr.m4 new file mode 100644 index 0000000000..a65407d955 --- /dev/null +++ b/m4/virt-xdr.m4 @@ -0,0 +1,60 @@ +dnl The XDR implementation check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_XDR], [ + with_xdr="no" + if test x"$with_remote" = x"yes" || test x"$with_libvirtd" = x"yes"; then + dnl Where are the XDR functions? + dnl If portablexdr is installed, prefer that. + dnl Otherwise try -lrpc (Cygwin) -lxdr (some MinGW), -lnsl (Solaris) + dnl -ltirpc (glibc 2.13.90 or newer) or none (most Unix) + AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[ + AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl tirpc],[], + [AC_MSG_ERROR([Cannot find a XDR library])]) + ]) + with_xdr="yes" + + dnl check for cygwin's variation in xdr function names + AC_CHECK_FUNCS([xdr_u_int64_t],[],[],[#include <rpc/xdr.h>]) + + dnl Cygwin/recent glibc requires -I/usr/include/tirpc for <rpc/rpc.h> + old_CFLAGS=$CFLAGS + AC_CACHE_CHECK([where to find <rpc/rpc.h>], [lv_cv_xdr_cflags], [ + for add_CFLAGS in '' '-I/usr/include/tirpc' 'missing'; do + if test x"$add_CFLAGS" = xmissing; then + lv_cv_xdr_cflags=missing; break + fi + CFLAGS="$old_CFLAGS $add_CFLAGS" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <rpc/rpc.h> + ]])], [lv_cv_xdr_cflags=${add_CFLAGS:-none}; break]) + done + ]) + CFLAGS=$old_CFLAGS + case $lv_cv_xdr_cflags in + none) XDR_CFLAGS= ;; + missing) AC_MSG_ERROR([Unable to find <rpc/rpc.h>]) ;; + *) XDR_CFLAGS=$lv_cv_xdr_cflags ;; + esac + AC_SUBST([XDR_CFLAGS]) + fi +]) + +AC_DEFUN([LIBVIRT_RESULT_XDR], [ + LIBVIRT_RESULT_LIB([XDR]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:50 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 40 ++------------------------------------- m4/virt-xdr.m4 | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 38 deletions(-) create mode 100644 m4/virt-xdr.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 42 +++--------------------------------- m4/virt-libpcap.m4 | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 39 deletions(-) create mode 100644 m4/virt-libpcap.m4 diff --git a/configure.ac b/configure.ac index e80528d211..c040707397 100644 --- a/configure.ac +++ b/configure.ac @@ -112,7 +112,6 @@ fi dnl Required minimum versions of all libs we depend on PARTED_REQUIRED="1.8.0" DEVMAPPER_REQUIRED=1.0.0 -LIBPCAP_REQUIRED="1.0.0" LIBNL_REQUIRED="1.1" PARALLELS_SDK_REQUIRED="7.0.22" dnl Where we look for daemons and admin binaries during configure @@ -1010,39 +1009,8 @@ if test "$with_numad" = "yes"; then fi AM_CONDITIONAL([HAVE_NUMAD], [test "$with_numad" != "no"]) -dnl pcap lib -LIBPCAP_CONFIG="pcap-config" -LIBPCAP_CFLAGS="" -LIBPCAP_LIBS="" -LIBPCAP_FOUND="no" - -LIBVIRT_ARG_WITH_ALT([LIBPCAP], [libpcap location], [check]) -if test "$with_qemu" = "yes"; then - case $with_libpcap in - no) LIBPCAP_CONFIG= ;; - ''|yes|check) LIBPCAP_CONFIG="pcap-config" ;; - *) LIBPCAP_CONFIG="$with_libpcap/bin/pcap-config" ;; - esac - AS_IF([test "x$LIBPCAP_CONFIG" != "x"], [ - AC_MSG_CHECKING(libpcap $LIBPCAP_CONFIG >= $LIBPCAP_REQUIRED ) - if ! $LIBPCAP_CONFIG --libs > /dev/null 2>&1 ; then - AC_MSG_RESULT(no) - else - LIBPCAP_LIBS="`$LIBPCAP_CONFIG --libs`" - LIBPCAP_CFLAGS="`$LIBPCAP_CONFIG --cflags`" - LIBPCAP_FOUND="yes" - AC_MSG_RESULT(yes) - fi - ]) -fi - -if test "x$LIBPCAP_FOUND" = "xyes"; then - AC_DEFINE_UNQUOTED([HAVE_LIBPCAP], 1, [whether libpcap can be used]) -fi - -AC_SUBST([LIBPCAP_CFLAGS]) -AC_SUBST([LIBPCAP_LIBS]) - +LIBVIRT_ARG_LIBPCAP +LIBVIRT_CHECK_LIBPCAP dnl @@ -2161,6 +2129,7 @@ LIBVIRT_RESULT_FUSE LIBVIRT_RESULT_GLUSTER LIBVIRT_RESULT_GNUTLS LIBVIRT_RESULT_HAL +LIBVIRT_RESULT_LIBPCAP LIBVIRT_RESULT_LIBSSH LIBVIRT_RESULT_LIBXML LIBVIRT_RESULT_NETCF @@ -2192,11 +2161,6 @@ AC_MSG_NOTICE([xenlight: $LIBXL_CFLAGS $LIBXL_LIBS]) else AC_MSG_NOTICE([xenlight: no]) fi -if test "$with_qemu" = "yes" && test "$LIBPCAP_FOUND" != "no"; then -AC_MSG_NOTICE([ pcap: $LIBPCAP_CFLAGS $LIBPCAP_LIBS]) -else -AC_MSG_NOTICE([ pcap: no]) -fi if test "$have_libnl" = "yes" ; then AC_MSG_NOTICE([ nl: $LIBNL_CFLAGS $LIBNL_LIBS]) else diff --git a/m4/virt-libpcap.m4 b/m4/virt-libpcap.m4 new file mode 100644 index 0000000000..a360194ee7 --- /dev/null +++ b/m4/virt-libpcap.m4 @@ -0,0 +1,63 @@ +dnl The pcap library +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_ARG_LIBPCAP], [ + LIBVIRT_ARG_WITH_ALT([LIBPCAP], [libpcap location], [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_LIBPCAP], [ + LIBPCAP_REQUIRED="1.0.0" + LIBPCAP_CONFIG="pcap-config" + LIBPCAP_CFLAGS="" + LIBPCAP_LIBS="" + LIBPCAP_FOUND="no" + + if test "$with_qemu" = "yes"; then + case $with_libpcap in + no) LIBPCAP_CONFIG= ;; + ''|yes|check) LIBPCAP_CONFIG="pcap-config" ;; + *) LIBPCAP_CONFIG="$with_libpcap/bin/pcap-config" ;; + esac + AS_IF([test "x$LIBPCAP_CONFIG" != "x"], [ + AC_MSG_CHECKING(libpcap $LIBPCAP_CONFIG >= $LIBPCAP_REQUIRED ) + if ! $LIBPCAP_CONFIG --libs > /dev/null 2>&1 ; then + AC_MSG_RESULT(no) + else + LIBPCAP_LIBS="`$LIBPCAP_CONFIG --libs`" + LIBPCAP_CFLAGS="`$LIBPCAP_CONFIG --cflags`" + LIBPCAP_FOUND="yes" + AC_MSG_RESULT(yes) + fi + ]) + fi + + if test "x$LIBPCAP_FOUND" = "xyes"; then + AC_DEFINE_UNQUOTED([HAVE_LIBPCAP], 1, [whether libpcap can be used]) + with_libpcap="yes" + else + with_libpcap="no" + fi + + AC_SUBST([LIBPCAP_CFLAGS]) + AC_SUBST([LIBPCAP_LIBS]) +]) + +AC_DEFUN([LIBVIRT_RESULT_LIBPCAP], [ + LIBVIRT_RESULT_LIB([LIBPCAP]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:51 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 42 +++--------------------------------- m4/virt-libpcap.m4 | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 39 deletions(-) create mode 100644 m4/virt-libpcap.m4
ACK Jirka

Libpcap is used by nwfilter driver and it could be build without QEMU driver. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-libpcap.m4 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/m4/virt-libpcap.m4 b/m4/virt-libpcap.m4 index a360194ee7..9cf47e66ab 100644 --- a/m4/virt-libpcap.m4 +++ b/m4/virt-libpcap.m4 @@ -28,9 +28,8 @@ AC_DEFUN([LIBVIRT_CHECK_LIBPCAP], [ LIBPCAP_LIBS="" LIBPCAP_FOUND="no" - if test "$with_qemu" = "yes"; then + if test "x$with_libpcap" != "xno"; then case $with_libpcap in - no) LIBPCAP_CONFIG= ;; ''|yes|check) LIBPCAP_CONFIG="pcap-config" ;; *) LIBPCAP_CONFIG="$with_libpcap/bin/pcap-config" ;; esac -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:52 +0100, Pavel Hrdina wrote:
Libpcap is used by nwfilter driver and it could be build without QEMU driver.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-libpcap.m4 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/m4/virt-libpcap.m4 b/m4/virt-libpcap.m4 index a360194ee7..9cf47e66ab 100644 --- a/m4/virt-libpcap.m4 +++ b/m4/virt-libpcap.m4 @@ -28,9 +28,8 @@ AC_DEFUN([LIBVIRT_CHECK_LIBPCAP], [ LIBPCAP_LIBS="" LIBPCAP_FOUND="no"
- if test "$with_qemu" = "yes"; then + if test "x$with_libpcap" != "xno"; then case $with_libpcap in - no) LIBPCAP_CONFIG= ;; ''|yes|check) LIBPCAP_CONFIG="pcap-config" ;; *) LIBPCAP_CONFIG="$with_libpcap/bin/pcap-config" ;; esac
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-libpcap.m4 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/m4/virt-libpcap.m4 b/m4/virt-libpcap.m4 index 9cf47e66ab..1175c195bc 100644 --- a/m4/virt-libpcap.m4 +++ b/m4/virt-libpcap.m4 @@ -26,7 +26,6 @@ AC_DEFUN([LIBVIRT_CHECK_LIBPCAP], [ LIBPCAP_CONFIG="pcap-config" LIBPCAP_CFLAGS="" LIBPCAP_LIBS="" - LIBPCAP_FOUND="no" if test "x$with_libpcap" != "xno"; then case $with_libpcap in @@ -36,21 +35,22 @@ AC_DEFUN([LIBVIRT_CHECK_LIBPCAP], [ AS_IF([test "x$LIBPCAP_CONFIG" != "x"], [ AC_MSG_CHECKING(libpcap $LIBPCAP_CONFIG >= $LIBPCAP_REQUIRED ) if ! $LIBPCAP_CONFIG --libs > /dev/null 2>&1 ; then + if test "x$with_libpcap" != "xcheck"; then + AC_MSG_ERROR([You must install libpcap >= $LIBPCAP_REQUIRED to compile libvirt]) + fi AC_MSG_RESULT(no) + with_libpcap="no" else LIBPCAP_LIBS="`$LIBPCAP_CONFIG --libs`" LIBPCAP_CFLAGS="`$LIBPCAP_CONFIG --cflags`" - LIBPCAP_FOUND="yes" + with_libpcap="yes" AC_MSG_RESULT(yes) fi ]) fi - if test "x$LIBPCAP_FOUND" = "xyes"; then + if test "x$with_libpcap" = "xyes"; then AC_DEFINE_UNQUOTED([HAVE_LIBPCAP], 1, [whether libpcap can be used]) - with_libpcap="yes" - else - with_libpcap="no" fi AC_SUBST([LIBPCAP_CFLAGS]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:53 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-libpcap.m4 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
ACK Jirka

This patch moves the macvtap result out of *Driver* section because it's not a driver. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 32 +++---------------------------- m4/virt-macvtap.m4 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 29 deletions(-) create mode 100644 m4/virt-macvtap.m4 diff --git a/configure.ac b/configure.ac index c040707397..694823b5e2 100644 --- a/configure.ac +++ b/configure.ac @@ -1796,34 +1796,8 @@ AC_PATH_PROG([QEMU_BRIDGE_HELPER], [qemu-bridge-helper], [/usr/libexec/qemu-brid [/usr/libexec:/usr/lib/qemu:/usr/lib]) AC_DEFINE_UNQUOTED([QEMU_BRIDGE_HELPER], ["$QEMU_BRIDGE_HELPER"], [QEMU bridge helper]) -LIBVIRT_ARG_WITH_ALT([MACVTAP], [enable macvtap device], [check]) - -AC_MSG_CHECKING([whether to compile with macvtap support]) -if test "$with_macvtap" != "no" ; then - AC_TRY_COMPILE([ #include <sys/socket.h> - #include <linux/rtnetlink.h> ], - [ int x = MACVLAN_MODE_BRIDGE; - int y = IFLA_VF_MAX; ], - [ with_macvtap=yes ], - [ if test "$with_macvtap" = "yes" ; then - AC_MSG_ERROR([Installed linux headers don't show support for macvtap device.]) - fi - with_macvtap=no ]) - if test "$with_macvtap" = "yes" ; then - val=1 - else - val=0 - fi - AC_DEFINE_UNQUOTED([WITH_MACVTAP], $val, [whether macvtap support is enabled]) -fi -AM_CONDITIONAL([WITH_MACVTAP], [test "$with_macvtap" = "yes"]) -AC_MSG_RESULT([$with_macvtap]) -if test "$with_macvtap" = yes; then - AC_CHECK_DECLS([MACVLAN_MODE_PASSTHRU], [], [], [[ - #include <sys/socket.h> - #include <linux/if_link.h> - ]]) -fi +LIBVIRT_ARG_MACVTAP +LIBVIRT_CHECK_MACVTAP LIBVIRT_ARG_WITH_ALT([VIRTUALPORT], [enable virtual port support], [check]) @@ -2086,7 +2060,6 @@ AC_MSG_NOTICE([ Remote: $with_remote]) AC_MSG_NOTICE([ Network: $with_network]) AC_MSG_NOTICE([ Libvirtd: $with_libvirtd]) AC_MSG_NOTICE([Interface: $with_interface]) -AC_MSG_NOTICE([ macvtap: $with_macvtap]) AC_MSG_NOTICE([ virtport: $with_virtualport]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) @@ -2132,6 +2105,7 @@ LIBVIRT_RESULT_HAL LIBVIRT_RESULT_LIBPCAP LIBVIRT_RESULT_LIBSSH LIBVIRT_RESULT_LIBXML +LIBVIRT_RESULT_MACVTAP LIBVIRT_RESULT_NETCF LIBVIRT_RESULT_NSS LIBVIRT_RESULT_NUMACTL diff --git a/m4/virt-macvtap.m4 b/m4/virt-macvtap.m4 new file mode 100644 index 0000000000..daf48b045a --- /dev/null +++ b/m4/virt-macvtap.m4 @@ -0,0 +1,56 @@ +dnl The macvtap support +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_ARG_MACVTAP], [ + LIBVIRT_ARG_WITH_ALT([MACVTAP], [enable macvtap device], [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_MACVTAP], [ + AC_MSG_CHECKING([whether to compile with macvtap support]) + if test "$with_macvtap" != "no" ; then + AC_TRY_COMPILE([ #include <sys/socket.h> + #include <linux/rtnetlink.h> ], + [ int x = MACVLAN_MODE_BRIDGE; + int y = IFLA_VF_MAX; ], + [ with_macvtap=yes ], + [ if test "$with_macvtap" = "yes" ; then + AC_MSG_ERROR([Installed linux headers don't show support for macvtap device.]) + fi + with_macvtap=no ]) + if test "$with_macvtap" = "yes" ; then + val=1 + else + val=0 + fi + AC_DEFINE_UNQUOTED([WITH_MACVTAP], $val, [whether macvtap support is enabled]) + fi + AM_CONDITIONAL([WITH_MACVTAP], [test "$with_macvtap" = "yes"]) + AC_MSG_RESULT([$with_macvtap]) + + if test "$with_macvtap" = yes; then + AC_CHECK_DECLS([MACVLAN_MODE_PASSTHRU], [], [], [[ + #include <sys/socket.h> + #include <linux/if_link.h> + ]]) + fi +]) + +AC_DEFUN([LIBVIRT_RESULT_MACVTAP], [ + LIBVIRT_RESULT_LIB([MACVTAP]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:54 +0100, Pavel Hrdina wrote:
This patch moves the macvtap result out of *Driver* section because it's not a driver.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 32 +++---------------------------- m4/virt-macvtap.m4 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 29 deletions(-) create mode 100644 m4/virt-macvtap.m4
ACK Jirka

This patch moves the virtualport result out of *Driver* section because it's not a driver. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 40 +++---------------------------- m4/virt-virtualport.m4 | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 37 deletions(-) create mode 100644 m4/virt-virtualport.m4 diff --git a/configure.ac b/configure.ac index 694823b5e2..b870ab68bc 100644 --- a/configure.ac +++ b/configure.ac @@ -1800,42 +1800,8 @@ LIBVIRT_ARG_MACVTAP LIBVIRT_CHECK_MACVTAP -LIBVIRT_ARG_WITH_ALT([VIRTUALPORT], [enable virtual port support], [check]) - -dnl Warn the user and error out if they requested virtualport support with configure -dnl options, but the required macvtap support isn't available - -if test "$with_virtualport" = "yes"; then - if test "$with_macvtap" = "no"; then - AC_MSG_ERROR([--with-virtualport requires --with-macvtap]) - fi -fi - -dnl virtualport checks - -if test "$with_macvtap" != "yes"; then - with_virtualport=no -fi -if test "$with_virtualport" != "no"; then - AC_MSG_CHECKING([whether to compile with virtual port support]) - AC_TRY_COMPILE([ #include <sys/socket.h> - #include <linux/rtnetlink.h> ], - [ int x = IFLA_PORT_MAX; ], - [ with_virtualport=yes ], - [ if test "$with_virtualport" = "yes" ; then - AC_MSG_ERROR([Installed linux headers don't show support for virtual port support.]) - fi - with_virtualport=no ]) - if test "$with_virtualport" = "yes"; then - val=1 - else - val=0 - fi - AC_DEFINE_UNQUOTED([WITH_VIRTUALPORT], $val, - [whether vsi vepa support is enabled]) - AC_MSG_RESULT([$with_virtualport]) -fi -AM_CONDITIONAL([WITH_VIRTUALPORT], [test "$with_virtualport" = "yes"]) +LIBVIRT_ARG_VIRTUALPORT +LIBVIRT_CHECK_VIRTUALPORT dnl GET_VLAN_VID_CMD is required for virNetDevGetVLanID AC_CHECK_DECLS([GET_VLAN_VID_CMD], [], [], [[#include <linux/if_vlan.h>]]) @@ -2060,7 +2026,6 @@ AC_MSG_NOTICE([ Remote: $with_remote]) AC_MSG_NOTICE([ Network: $with_network]) AC_MSG_NOTICE([ Libvirtd: $with_libvirtd]) AC_MSG_NOTICE([Interface: $with_interface]) -AC_MSG_NOTICE([ virtport: $with_virtualport]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) @@ -2118,6 +2083,7 @@ LIBVIRT_RESULT_SASL LIBVIRT_RESULT_SELINUX LIBVIRT_RESULT_SSH2 LIBVIRT_RESULT_UDEV +LIBVIRT_RESULT_VIRTUALPORT LIBVIRT_RESULT_XDR LIBVIRT_RESULT_YAJL if test "$with_xen" = "yes" ; then diff --git a/m4/virt-virtualport.m4 b/m4/virt-virtualport.m4 new file mode 100644 index 0000000000..9074fb6388 --- /dev/null +++ b/m4/virt-virtualport.m4 @@ -0,0 +1,65 @@ +dnl The virtualport support check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_ARG_VIRTUALPORT], [ + LIBVIRT_ARG_WITH_ALT([VIRTUALPORT], [enable virtual port support], [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_VIRTUALPORT],[ + AC_REQUIRE([LIBVIRT_CHECK_MACVTAP]) + + dnl Warn the user and error out if they requested virtualport support + dnl with configure options, but the required macvtap support isn't available + + if test "$with_virtualport" = "yes"; then + if test "$with_macvtap" = "no"; then + AC_MSG_ERROR([--with-virtualport requires --with-macvtap]) + fi + fi + + dnl virtualport checks + + if test "$with_macvtap" != "yes"; then + with_virtualport=no + fi + if test "$with_virtualport" != "no"; then + AC_MSG_CHECKING([whether to compile with virtual port support]) + AC_TRY_COMPILE([ #include <sys/socket.h> + #include <linux/rtnetlink.h> ], + [ int x = IFLA_PORT_MAX; ], + [ with_virtualport=yes ], + [ if test "$with_virtualport" = "yes" ; then + AC_MSG_ERROR([Installed linux headers don't show support for virtual port support.]) + fi + with_virtualport=no ]) + if test "$with_virtualport" = "yes"; then + val=1 + else + val=0 + fi + AC_DEFINE_UNQUOTED([WITH_VIRTUALPORT], $val, + [whether vsi vepa support is enabled]) + AC_MSG_RESULT([$with_virtualport]) + fi + AM_CONDITIONAL([WITH_VIRTUALPORT], [test "$with_virtualport" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_RESULT_VIRTUALPORT],[ + LIBVIRT_RESULT_LIB([VIRTUALPORT]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:55 +0100, Pavel Hrdina wrote:
This patch moves the virtualport result out of *Driver* section because it's not a driver.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 40 +++---------------------------- m4/virt-virtualport.m4 | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 37 deletions(-) create mode 100644 m4/virt-virtualport.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 60 ++--------------------------------------- m4/virt-libnl.m4 | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 58 deletions(-) create mode 100644 m4/virt-libnl.m4 diff --git a/configure.ac b/configure.ac index b870ab68bc..94812e8edd 100644 --- a/configure.ac +++ b/configure.ac @@ -112,7 +112,6 @@ fi dnl Required minimum versions of all libs we depend on PARTED_REQUIRED="1.8.0" DEVMAPPER_REQUIRED=1.0.0 -LIBNL_REQUIRED="1.1" PARALLELS_SDK_REQUIRED="7.0.22" dnl Where we look for daemons and admin binaries during configure LIBVIRT_SBIN_PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin" @@ -1808,58 +1807,7 @@ AC_CHECK_DECLS([GET_VLAN_VID_CMD], [], [], [[#include <linux/if_vlan.h>]]) dnl netlink library -have_libnl=no - -if test "$with_linux" = "yes"; then - # When linking with netcf, we must ensure that we pick the same version - # of libnl that netcf picked. Prefer libnl-3 unless we can prove - # netcf linked against libnl-1, or unless the user set LIBNL_CFLAGS. - # (Setting LIBNL_CFLAGS is already used by PKG_CHECK_MODULES to - # override any probing, so if it set, you know which libnl is in use.) - libnl_ldd= - for dir in /usr/lib64 /usr/lib /usr/lib/*-linux-gnu*; do - if test -f $dir/libnetcf.so; then - libnl_ldd=`(ldd $dir/libnetcf.so) 2>&1` - break - fi - done - case $libnl_ldd:${LIBNL_CFLAGS+set} in - *libnl-3.so.*:) LIBNL_REQUIRED=3.0 ;; - esac - case $libnl_ldd:${LIBNL_CFLAGS+set} in - *libnl.so.1*:) ;; - *) - PKG_CHECK_MODULES([LIBNL], [libnl-3.0], [ - have_libnl=yes - AC_DEFINE([HAVE_LIBNL3], [1], [Use libnl-3.0]) - AC_DEFINE([HAVE_LIBNL], [1], [whether the netlink library is available]) - PKG_CHECK_MODULES([LIBNL_ROUTE3], [libnl-route-3.0]) - LIBNL_CFLAGS="$LIBNL_CFLAGS $LIBNL_ROUTE3_CFLAGS" - LIBNL_LIBS="$LIBNL_LIBS $LIBNL_ROUTE3_LIBS" - ], [:]) ;; - esac - if test "$have_libnl" = no; then - PKG_CHECK_MODULES([LIBNL], [libnl-1 >= $LIBNL_REQUIRED], [ - have_libnl=yes - AC_DEFINE_UNQUOTED([HAVE_LIBNL], [1], - [whether the netlink library is available]) - AC_DEFINE_UNQUOTED([HAVE_LIBNL1], [1], - [whether the netlink v1 library is available]) - ], [ - if test "$with_macvtap" = "yes"; then - if test "$LIBNL_REQUIRED" = "3.0";then - AC_MSG_ERROR([libnl3-devel >= $LIBNL_REQUIRED is required for macvtap support]) - else - AC_MSG_ERROR([libnl-devel >= $LIBNL_REQUIRED is required for macvtap support]) - fi - fi - ]) - fi -fi -AM_CONDITIONAL([HAVE_LIBNL], [test "$have_libnl" = "yes"]) - -AC_SUBST([LIBNL_CFLAGS]) -AC_SUBST([LIBNL_LIBS]) +LIBVIRT_CHECK_LIBNL # Check for Linux vs. BSD ifreq members AC_CHECK_MEMBERS([struct ifreq.ifr_newname, @@ -2067,6 +2015,7 @@ LIBVIRT_RESULT_FUSE LIBVIRT_RESULT_GLUSTER LIBVIRT_RESULT_GNUTLS LIBVIRT_RESULT_HAL +LIBVIRT_RESULT_LIBNL LIBVIRT_RESULT_LIBPCAP LIBVIRT_RESULT_LIBSSH LIBVIRT_RESULT_LIBXML @@ -2101,11 +2050,6 @@ AC_MSG_NOTICE([xenlight: $LIBXL_CFLAGS $LIBXL_LIBS]) else AC_MSG_NOTICE([xenlight: no]) fi -if test "$have_libnl" = "yes" ; then -AC_MSG_NOTICE([ nl: $LIBNL_CFLAGS $LIBNL_LIBS]) -else -AC_MSG_NOTICE([ nl: no]) -fi if test "$with_vbox" = "yes" && test -n "$MSCOM_LIBS" ; then AC_MSG_NOTICE([ mscom: $MSCOM_LIBS]) else diff --git a/m4/virt-libnl.m4 b/m4/virt-libnl.m4 new file mode 100644 index 0000000000..c106d545ec --- /dev/null +++ b/m4/virt-libnl.m4 @@ -0,0 +1,81 @@ +dnl The libnl library +dnl +dnl Copyright (C) 2012-2013 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_LIBNL], [ + AC_REQUIRE([LIBVIRT_CHECK_NETCF]) + AC_REQUIRE([LIBVIRT_CHECK_MACVTAP]) + + LIBNL_REQUIRED="1.1" + with_libnl=no + + if test "$with_linux" = "yes"; then + # When linking with netcf, we must ensure that we pick the same version + # of libnl that netcf picked. Prefer libnl-3 unless we can prove + # netcf linked against libnl-1, or unless the user set LIBNL_CFLAGS. + # (Setting LIBNL_CFLAGS is already used by PKG_CHECK_MODULES to + # override any probing, so if it set, you know which libnl is in use.) + libnl_ldd= + for dir in /usr/lib64 /usr/lib /usr/lib/*-linux-gnu*; do + if test -f $dir/libnetcf.so; then + libnl_ldd=`(ldd $dir/libnetcf.so) 2>&1` + break + fi + done + case $libnl_ldd:${LIBNL_CFLAGS+set} in + *libnl-3.so.*:) LIBNL_REQUIRED=3.0 ;; + esac + case $libnl_ldd:${LIBNL_CFLAGS+set} in + *libnl.so.1*:) ;; + *) + PKG_CHECK_MODULES([LIBNL], [libnl-3.0], [ + with_libnl=yes + AC_DEFINE([HAVE_LIBNL3], [1], [Use libnl-3.0]) + AC_DEFINE([HAVE_LIBNL], [1], [whether the netlink library is available]) + PKG_CHECK_MODULES([LIBNL_ROUTE3], [libnl-route-3.0]) + LIBNL_CFLAGS="$LIBNL_CFLAGS $LIBNL_ROUTE3_CFLAGS" + LIBNL_LIBS="$LIBNL_LIBS $LIBNL_ROUTE3_LIBS" + ], [:]) ;; + esac + if test "$with_libnl" = no; then + PKG_CHECK_MODULES([LIBNL], [libnl-1 >= $LIBNL_REQUIRED], [ + with_libnl=yes + AC_DEFINE_UNQUOTED([HAVE_LIBNL], [1], + [whether the netlink library is available]) + AC_DEFINE_UNQUOTED([HAVE_LIBNL1], [1], + [whether the netlink v1 library is available]) + ], [ + if test "$with_macvtap" = "yes"; then + if test "$LIBNL_REQUIRED" = "3.0";then + AC_MSG_ERROR([libnl3-devel >= $LIBNL_REQUIRED is required for macvtap support]) + else + AC_MSG_ERROR([libnl-devel >= $LIBNL_REQUIRED is required for macvtap support]) + fi + fi + ]) + fi + fi + AM_CONDITIONAL([HAVE_LIBNL], [test "$with_libnl" = "yes"]) + + AC_SUBST([LIBNL_CFLAGS]) + AC_SUBST([LIBNL_LIBS]) +]) + +AC_DEFUN([LIBVIRT_RESULT_LIBNL], [ + LIBVIRT_RESULT_LIB([LIBNL]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:56 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 60 ++--------------------------------------- m4/virt-libnl.m4 | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 58 deletions(-) create mode 100644 m4/virt-libnl.m4
ACK Jirka

This renames MSCOM_LIBS to WIN32_EXTRA_LIBS to make it consistent with WIN32_EXTRA_CFLAGS. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 30 ++++++++---------------------- m4/virt-win-common.m4 | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 4 ++-- 3 files changed, 54 insertions(+), 24 deletions(-) create mode 100644 m4/virt-win-common.m4 diff --git a/configure.ac b/configure.ac index 94812e8edd..7f03f71b6d 100644 --- a/configure.ac +++ b/configure.ac @@ -1638,43 +1638,32 @@ AC_SUBST([GETTEXT_CPPFLAGS]) ALL_LINGUAS=`cd "$srcdir/po" > /dev/null && ls *.po | sed 's+\.po$++'` +dnl Cygwin, MinGW and MSVC checks +LIBVIRT_WIN_CHECK_COMMON + + dnl Extra link-time flags for Cygwin. dnl Copied from libxml2 configure.in, but I removed mingw changes dnl for now since I'm not supporting mingw at present. - RWMJ CYGWIN_EXTRA_LDFLAGS= CYGWIN_EXTRA_LIBADD= MINGW_EXTRA_LDFLAGS= -WIN32_EXTRA_CFLAGS= dnl libvirt.syms is generated in builddir, but libvirt_qemu.syms is in git; dnl hence the asymmetric naming of these two symbol files. LIBVIRT_SYMBOL_FILE=libvirt.syms LIBVIRT_ADMIN_SYMBOL_FILE=libvirt_admin.syms LIBVIRT_LXC_SYMBOL_FILE='$(srcdir)/libvirt_lxc.syms' LIBVIRT_QEMU_SYMBOL_FILE='$(srcdir)/libvirt_qemu.syms' -MSCOM_LIBS= case "$host" in *-*-cygwin*) CYGWIN_EXTRA_LDFLAGS="-no-undefined" CYGWIN_EXTRA_LIBADD="${INTLLIBS}" - MSCOM_LIBS="-lole32 -loleaut32" ;; *-*-mingw*) MINGW_EXTRA_LDFLAGS="-no-undefined" - MSCOM_LIBS="-lole32 -loleaut32" - ;; - *-*-msvc*) - MSCOM_LIBS="-lole32 -loleaut32" ;; esac case "$host" in - *-*-mingw* | *-*-cygwin* | *-*-msvc* ) - # If the host is Windows, and shared libraries are disabled, we - # need to add -DLIBVIRT_STATIC to the CFLAGS for proper linking - if test "x$enable_shared" = "xno"; then - WIN32_EXTRA_CFLAGS="-DLIBVIRT_STATIC" - fi -esac -case "$host" in *-*-mingw* | *-*-msvc* ) # Also set the symbol file to .def, so src/Makefile generates libvirt.def # from libvirt.syms and passes libvirt.def instead of libvirt.syms to the linker @@ -1693,13 +1682,11 @@ esac AC_SUBST([CYGWIN_EXTRA_LDFLAGS]) AC_SUBST([CYGWIN_EXTRA_LIBADD]) AC_SUBST([MINGW_EXTRA_LDFLAGS]) -AC_SUBST([WIN32_EXTRA_CFLAGS]) AC_SUBST([LIBVIRT_SYMBOL_FILE]) AC_SUBST([LIBVIRT_ADMIN_SYMBOL_FILE]) AC_SUBST([LIBVIRT_LXC_SYMBOL_FILE]) AC_SUBST([LIBVIRT_QEMU_SYMBOL_FILE]) AC_SUBST([VERSION_SCRIPT_FLAGS]) -AC_SUBST([MSCOM_LIBS]) dnl Look for windres to build a Windows icon resource. @@ -2050,11 +2037,6 @@ AC_MSG_NOTICE([xenlight: $LIBXL_CFLAGS $LIBXL_LIBS]) else AC_MSG_NOTICE([xenlight: no]) fi -if test "$with_vbox" = "yes" && test -n "$MSCOM_LIBS" ; then -AC_MSG_NOTICE([ mscom: $MSCOM_LIBS]) -else -AC_MSG_NOTICE([ mscom: no]) -fi if test "$with_storage_rbd" = "yes" ; then AC_MSG_NOTICE([ rbd: $LIBRBD_LIBS]) else @@ -2063,6 +2045,10 @@ fi AC_MSG_NOTICE([pm-utils: $with_pm_utils]) AC_MSG_NOTICE([]) +AC_MSG_NOTICE([Windows]) +AC_MSG_NOTICE([]) +LIBVIRT_WIN_RESULT_COMMON +AC_MSG_NOTICE([]) AC_MSG_NOTICE([Test suite]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([ Coverage: $enable_coverage]) diff --git a/m4/virt-win-common.m4 b/m4/virt-win-common.m4 new file mode 100644 index 0000000000..b639866e64 --- /dev/null +++ b/m4/virt-win-common.m4 @@ -0,0 +1,44 @@ +dnl The Cygwin, MinGW and MSVC common checks +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_WIN_CHECK_COMMON], [ + WIN32_EXTRA_CFLAGS= + WIN32_EXTRA_LIBS= + + case "$host" in + *-*-mingw* | *-*-cygwin* | *-*-msvc* ) + WIN32_EXTRA_LIBS="-lole32 -loleaut32" + # If the host is Windows, and shared libraries are disabled, we + # need to add -DLIBVIRT_STATIC to the CFLAGS for proper linking + if test "x$enable_shared" = "xno"; then + WIN32_EXTRA_CFLAGS="-DLIBVIRT_STATIC" + fi + ;; + esac + + AC_SUBST([WIN32_EXTRA_CFLAGS]) + AC_SUBST([WIN32_EXTRA_LIBS]) +]) + +AC_DEFUN([LIBVIRT_WIN_RESULT_COMMON], [ + details="CFLAGS='$WIN32_EXTRA_CFLAGS' LIBS='$WIN32_EXTRA_LIBS'" + LIBVIRT_RESULT([Cygwin], [$with_cygwin], [$details]) + LIBVIRT_RESULT([MinGW], [$with_cygwin], [$details]) + LIBVIRT_RESULT([MSVC], [$with_cygwin], [$details]) +]) diff --git a/src/Makefile.am b/src/Makefile.am index 49abcf25d2..262528cb14 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1132,7 +1132,7 @@ libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \ -I$(srcdir)/conf libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \ $(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \ - $(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS) \ + $(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(WIN32_EXTRA_LIBS) $(LIBXML_LIBS) \ $(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(ACL_LIBS) \ $(POLKIT_LIBS) @@ -1308,7 +1308,7 @@ libvirt_driver_vbox_impl_la_CFLAGS = \ -DVBOX_DRIVER libvirt_driver_vbox_impl_la_LDFLAGS = $(AM_LDFLAGS) libvirt_driver_vbox_impl_la_LIBADD = $(DLOPEN_LIBS) \ - $(MSCOM_LIBS) \ + $(WIN32_EXTRA_LIBS) \ $(LIBXML_LIBS) libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES) endif WITH_VBOX -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:57 +0100, Pavel Hrdina wrote:
This renames MSCOM_LIBS to WIN32_EXTRA_LIBS to make it consistent with WIN32_EXTRA_CFLAGS.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 30 ++++++++---------------------- m4/virt-win-common.m4 | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 4 ++-- 3 files changed, 54 insertions(+), 24 deletions(-) create mode 100644 m4/virt-win-common.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 12 +----------- m4/virt-win-cygwin.m4 | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 m4/virt-win-cygwin.m4 diff --git a/configure.ac b/configure.ac index 7f03f71b6d..1a2658bb87 100644 --- a/configure.ac +++ b/configure.ac @@ -1640,13 +1640,9 @@ ALL_LINGUAS=`cd "$srcdir/po" > /dev/null && ls *.po | sed 's+\.po$++'` dnl Cygwin, MinGW and MSVC checks LIBVIRT_WIN_CHECK_COMMON +LIBVIRT_WIN_CHECK_CYGWIN -dnl Extra link-time flags for Cygwin. -dnl Copied from libxml2 configure.in, but I removed mingw changes -dnl for now since I'm not supporting mingw at present. - RWMJ -CYGWIN_EXTRA_LDFLAGS= -CYGWIN_EXTRA_LIBADD= MINGW_EXTRA_LDFLAGS= dnl libvirt.syms is generated in builddir, but libvirt_qemu.syms is in git; dnl hence the asymmetric naming of these two symbol files. @@ -1655,10 +1651,6 @@ LIBVIRT_ADMIN_SYMBOL_FILE=libvirt_admin.syms LIBVIRT_LXC_SYMBOL_FILE='$(srcdir)/libvirt_lxc.syms' LIBVIRT_QEMU_SYMBOL_FILE='$(srcdir)/libvirt_qemu.syms' case "$host" in - *-*-cygwin*) - CYGWIN_EXTRA_LDFLAGS="-no-undefined" - CYGWIN_EXTRA_LIBADD="${INTLLIBS}" - ;; *-*-mingw*) MINGW_EXTRA_LDFLAGS="-no-undefined" ;; @@ -1679,8 +1671,6 @@ case "$host" in VERSION_SCRIPT_FLAGS="-Wl," ;; esac -AC_SUBST([CYGWIN_EXTRA_LDFLAGS]) -AC_SUBST([CYGWIN_EXTRA_LIBADD]) AC_SUBST([MINGW_EXTRA_LDFLAGS]) AC_SUBST([LIBVIRT_SYMBOL_FILE]) AC_SUBST([LIBVIRT_ADMIN_SYMBOL_FILE]) diff --git a/m4/virt-win-cygwin.m4 b/m4/virt-win-cygwin.m4 new file mode 100644 index 0000000000..211b3c2b7b --- /dev/null +++ b/m4/virt-win-cygwin.m4 @@ -0,0 +1,32 @@ +dnl The Cygwin check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_WIN_CHECK_CYGWIN], [ + CYGWIN_EXTRA_LDFLAGS= + CYGWIN_EXTRA_LIBADD= + case "$host" in + *-*-cygwin*) + CYGWIN_EXTRA_LDFLAGS="-no-undefined" + CYGWIN_EXTRA_LIBADD="${INTLLIBS}" + ;; + esac + + AC_SUBST([CYGWIN_EXTRA_LDFLAGS]) + AC_SUBST([CYGWIN_EXTRA_LIBADD]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:58 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 12 +----------- m4/virt-win-cygwin.m4 | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 m4/virt-win-cygwin.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 8 +------- m4/virt-win-mingw.m4 | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 m4/virt-win-mingw.m4 diff --git a/configure.ac b/configure.ac index 1a2658bb87..be17961546 100644 --- a/configure.ac +++ b/configure.ac @@ -1641,9 +1641,9 @@ ALL_LINGUAS=`cd "$srcdir/po" > /dev/null && ls *.po | sed 's+\.po$++'` dnl Cygwin, MinGW and MSVC checks LIBVIRT_WIN_CHECK_COMMON LIBVIRT_WIN_CHECK_CYGWIN +LIBVIRT_WIN_CHECK_MINGW -MINGW_EXTRA_LDFLAGS= dnl libvirt.syms is generated in builddir, but libvirt_qemu.syms is in git; dnl hence the asymmetric naming of these two symbol files. LIBVIRT_SYMBOL_FILE=libvirt.syms @@ -1651,11 +1651,6 @@ LIBVIRT_ADMIN_SYMBOL_FILE=libvirt_admin.syms LIBVIRT_LXC_SYMBOL_FILE='$(srcdir)/libvirt_lxc.syms' LIBVIRT_QEMU_SYMBOL_FILE='$(srcdir)/libvirt_qemu.syms' case "$host" in - *-*-mingw*) - MINGW_EXTRA_LDFLAGS="-no-undefined" - ;; -esac -case "$host" in *-*-mingw* | *-*-msvc* ) # Also set the symbol file to .def, so src/Makefile generates libvirt.def # from libvirt.syms and passes libvirt.def instead of libvirt.syms to the linker @@ -1671,7 +1666,6 @@ case "$host" in VERSION_SCRIPT_FLAGS="-Wl," ;; esac -AC_SUBST([MINGW_EXTRA_LDFLAGS]) AC_SUBST([LIBVIRT_SYMBOL_FILE]) AC_SUBST([LIBVIRT_ADMIN_SYMBOL_FILE]) AC_SUBST([LIBVIRT_LXC_SYMBOL_FILE]) diff --git a/m4/virt-win-mingw.m4 b/m4/virt-win-mingw.m4 new file mode 100644 index 0000000000..3003bcf031 --- /dev/null +++ b/m4/virt-win-mingw.m4 @@ -0,0 +1,28 @@ +dnl The MinGW check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_WIN_CHECK_MINGW], [ + MINGW_EXTRA_LDFLAGS= + case "$host" in + *-*-mingw*) + MINGW_EXTRA_LDFLAGS="-no-undefined" + esac + + AC_SUBST([MINGW_EXTRA_LDFLAGS]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:10:59 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 8 +------- m4/virt-win-mingw.m4 | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 m4/virt-win-mingw.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 17 +---------------- m4/virt-win-symbols.m4 | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 16 deletions(-) create mode 100644 m4/virt-win-symbols.m4 diff --git a/configure.ac b/configure.ac index be17961546..ff46b1e735 100644 --- a/configure.ac +++ b/configure.ac @@ -1642,22 +1642,11 @@ dnl Cygwin, MinGW and MSVC checks LIBVIRT_WIN_CHECK_COMMON LIBVIRT_WIN_CHECK_CYGWIN LIBVIRT_WIN_CHECK_MINGW +LIBVIRT_WIN_CHECK_SYMBOLS -dnl libvirt.syms is generated in builddir, but libvirt_qemu.syms is in git; -dnl hence the asymmetric naming of these two symbol files. -LIBVIRT_SYMBOL_FILE=libvirt.syms -LIBVIRT_ADMIN_SYMBOL_FILE=libvirt_admin.syms -LIBVIRT_LXC_SYMBOL_FILE='$(srcdir)/libvirt_lxc.syms' -LIBVIRT_QEMU_SYMBOL_FILE='$(srcdir)/libvirt_qemu.syms' case "$host" in *-*-mingw* | *-*-msvc* ) - # Also set the symbol file to .def, so src/Makefile generates libvirt.def - # from libvirt.syms and passes libvirt.def instead of libvirt.syms to the linker - LIBVIRT_SYMBOL_FILE=libvirt.def - LIBVIRT_ADMIN_SYMBOL_FILE=libvirt_admin.def - LIBVIRT_LXC_SYMBOL_FILE=libvirt_lxc.def - LIBVIRT_QEMU_SYMBOL_FILE=libvirt_qemu.def # mingw's ld has the --version-script parameter, but it requires a .def file # instead to work properly, therefore clear --version-script here and use # -Wl, to pass the .def file to the linker @@ -1666,10 +1655,6 @@ case "$host" in VERSION_SCRIPT_FLAGS="-Wl," ;; esac -AC_SUBST([LIBVIRT_SYMBOL_FILE]) -AC_SUBST([LIBVIRT_ADMIN_SYMBOL_FILE]) -AC_SUBST([LIBVIRT_LXC_SYMBOL_FILE]) -AC_SUBST([LIBVIRT_QEMU_SYMBOL_FILE]) AC_SUBST([VERSION_SCRIPT_FLAGS]) diff --git a/m4/virt-win-symbols.m4 b/m4/virt-win-symbols.m4 new file mode 100644 index 0000000000..3b2038e6bf --- /dev/null +++ b/m4/virt-win-symbols.m4 @@ -0,0 +1,40 @@ +dnl The Cygwin, MinGW and MSVC symbols checks +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_WIN_CHECK_SYMBOLS], [ + LIBVIRT_SYMBOL_FILE=libvirt.syms + LIBVIRT_ADMIN_SYMBOL_FILE=libvirt_admin.syms + LIBVIRT_LXC_SYMBOL_FILE='$(srcdir)/libvirt_lxc.syms' + LIBVIRT_QEMU_SYMBOL_FILE='$(srcdir)/libvirt_qemu.syms' + case "$host" in + *-*-mingw* | *-*-msvc* ) + # Also set the symbol file to .def, so src/Makefile generates libvirt.def + # from libvirt.syms and passes libvirt.def instead of libvirt.syms to the + # linker + LIBVIRT_SYMBOL_FILE=libvirt.def + LIBVIRT_ADMIN_SYMBOL_FILE=libvirt_admin.def + LIBVIRT_LXC_SYMBOL_FILE=libvirt_lxc.def + LIBVIRT_QEMU_SYMBOL_FILE=libvirt_qemu.def + ;; + esac + AC_SUBST([LIBVIRT_SYMBOL_FILE]) + AC_SUBST([LIBVIRT_ADMIN_SYMBOL_FILE]) + AC_SUBST([LIBVIRT_LXC_SYMBOL_FILE]) + AC_SUBST([LIBVIRT_QEMU_SYMBOL_FILE]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:00 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 17 +---------------- m4/virt-win-symbols.m4 | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 16 deletions(-) create mode 100644 m4/virt-win-symbols.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 11 ++--------- m4/virt-win-windres.m4 | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 m4/virt-win-windres.m4 diff --git a/configure.ac b/configure.ac index ff46b1e735..99741a301a 100644 --- a/configure.ac +++ b/configure.ac @@ -1643,6 +1643,7 @@ LIBVIRT_WIN_CHECK_COMMON LIBVIRT_WIN_CHECK_CYGWIN LIBVIRT_WIN_CHECK_MINGW LIBVIRT_WIN_CHECK_SYMBOLS +LIBVIRT_WIN_CHECK_WINDRES case "$host" in @@ -1658,15 +1659,6 @@ esac AC_SUBST([VERSION_SCRIPT_FLAGS]) -dnl Look for windres to build a Windows icon resource. -case "$host" in - *-*-mingw* | *-*-cygwin* | *-*-msvc* ) - AC_CHECK_TOOL([WINDRES], [windres], []) - ;; -esac -AM_CONDITIONAL([WITH_WIN_ICON], [test "$WINDRES" != ""]) - - dnl Driver-Modules library support LIBVIRT_ARG_DRIVER_MODULES LIBVIRT_CHECK_DRIVER_MODULES @@ -2017,6 +2009,7 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Windows]) AC_MSG_NOTICE([]) LIBVIRT_WIN_RESULT_COMMON +LIBVIRT_WIN_RESULT_WINDRES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Test suite]) AC_MSG_NOTICE([]) diff --git a/m4/virt-win-windres.m4 b/m4/virt-win-windres.m4 new file mode 100644 index 0000000000..c7b5d2a179 --- /dev/null +++ b/m4/virt-win-windres.m4 @@ -0,0 +1,34 @@ +dnl The Cygwin, MinGW and MSVC windres checks +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_WIN_CHECK_WINDRES], [ + dnl Look for windres to build a Windows icon resource. + with_windres=no + case "$host" in + *-*-mingw* | *-*-cygwin* | *-*-msvc* ) + with_windres=yes + AC_CHECK_TOOL([WINDRES], [windres], []) + ;; + esac + AM_CONDITIONAL([WITH_WIN_ICON], [test "$WINDRES" != ""]) +]) + +AC_DEFUN([LIBVIRT_WIN_RESULT_WINDRES], [ + LIBVIRT_RESULT([windres], [$with_windres], [$WINDRES]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:01 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 11 ++--------- m4/virt-win-windres.m4 | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 m4/virt-win-windres.m4
diff --git a/configure.ac b/configure.ac index ff46b1e735..99741a301a 100644 --- a/configure.ac +++ b/configure.ac @@ -1643,6 +1643,7 @@ LIBVIRT_WIN_CHECK_COMMON LIBVIRT_WIN_CHECK_CYGWIN LIBVIRT_WIN_CHECK_MINGW LIBVIRT_WIN_CHECK_SYMBOLS +LIBVIRT_WIN_CHECK_WINDRES
case "$host" in @@ -1658,15 +1659,6 @@ esac AC_SUBST([VERSION_SCRIPT_FLAGS])
-dnl Look for windres to build a Windows icon resource. -case "$host" in - *-*-mingw* | *-*-cygwin* | *-*-msvc* ) - AC_CHECK_TOOL([WINDRES], [windres], []) - ;; -esac -AM_CONDITIONAL([WITH_WIN_ICON], [test "$WINDRES" != ""]) - - dnl Driver-Modules library support LIBVIRT_ARG_DRIVER_MODULES LIBVIRT_CHECK_DRIVER_MODULES @@ -2017,6 +2009,7 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Windows]) AC_MSG_NOTICE([]) LIBVIRT_WIN_RESULT_COMMON +LIBVIRT_WIN_RESULT_WINDRES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Test suite]) AC_MSG_NOTICE([]) diff --git a/m4/virt-win-windres.m4 b/m4/virt-win-windres.m4 new file mode 100644 index 0000000000..c7b5d2a179 --- /dev/null +++ b/m4/virt-win-windres.m4 @@ -0,0 +1,34 @@ +dnl The Cygwin, MinGW and MSVC windres checks +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_WIN_CHECK_WINDRES], [ + dnl Look for windres to build a Windows icon resource. + with_windres=no + case "$host" in + *-*-mingw* | *-*-cygwin* | *-*-msvc* ) + with_windres=yes + AC_CHECK_TOOL([WINDRES], [windres], [])
Shouldn't with_windres=yes be set only if the tool is found?
+ ;; + esac + AM_CONDITIONAL([WITH_WIN_ICON], [test "$WINDRES" != ""]) +]) + +AC_DEFUN([LIBVIRT_WIN_RESULT_WINDRES], [ + LIBVIRT_RESULT([windres], [$with_windres], [$WINDRES])
This would print "windres: yes" if $WINDRES is "".
+])
Jirka

On Tue, Dec 20, 2016 at 01:41:11PM +0100, Jiri Denemark wrote:
On Fri, Dec 16, 2016 at 10:11:01 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 11 ++--------- m4/virt-win-windres.m4 | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 m4/virt-win-windres.m4
diff --git a/configure.ac b/configure.ac index ff46b1e735..99741a301a 100644 --- a/configure.ac +++ b/configure.ac @@ -1643,6 +1643,7 @@ LIBVIRT_WIN_CHECK_COMMON LIBVIRT_WIN_CHECK_CYGWIN LIBVIRT_WIN_CHECK_MINGW LIBVIRT_WIN_CHECK_SYMBOLS +LIBVIRT_WIN_CHECK_WINDRES
case "$host" in @@ -1658,15 +1659,6 @@ esac AC_SUBST([VERSION_SCRIPT_FLAGS])
-dnl Look for windres to build a Windows icon resource. -case "$host" in - *-*-mingw* | *-*-cygwin* | *-*-msvc* ) - AC_CHECK_TOOL([WINDRES], [windres], []) - ;; -esac -AM_CONDITIONAL([WITH_WIN_ICON], [test "$WINDRES" != ""]) - - dnl Driver-Modules library support LIBVIRT_ARG_DRIVER_MODULES LIBVIRT_CHECK_DRIVER_MODULES @@ -2017,6 +2009,7 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Windows]) AC_MSG_NOTICE([]) LIBVIRT_WIN_RESULT_COMMON +LIBVIRT_WIN_RESULT_WINDRES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Test suite]) AC_MSG_NOTICE([]) diff --git a/m4/virt-win-windres.m4 b/m4/virt-win-windres.m4 new file mode 100644 index 0000000000..c7b5d2a179 --- /dev/null +++ b/m4/virt-win-windres.m4 @@ -0,0 +1,34 @@ +dnl The Cygwin, MinGW and MSVC windres checks +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_WIN_CHECK_WINDRES], [ + dnl Look for windres to build a Windows icon resource. + with_windres=no + case "$host" in + *-*-mingw* | *-*-cygwin* | *-*-msvc* ) + with_windres=yes + AC_CHECK_TOOL([WINDRES], [windres], [])
Shouldn't with_windres=yes be set only if the tool is found?
Nice catch, I'll fix that: diff --git a/m4/virt-win-windres.m4 b/m4/virt-win-windres.m4 index c7b5d2a179..7f98c9fbff 100644 --- a/m4/virt-win-windres.m4 +++ b/m4/virt-win-windres.m4 @@ -22,11 +22,12 @@ AC_DEFUN([LIBVIRT_WIN_CHECK_WINDRES], [ with_windres=no case "$host" in *-*-mingw* | *-*-cygwin* | *-*-msvc* ) - with_windres=yes AC_CHECK_TOOL([WINDRES], [windres], []) + if test "x$WINDRES" != "x"; then + with_windres=yes ;; esac - AM_CONDITIONAL([WITH_WIN_ICON], [test "$WINDRES" != ""]) + AM_CONDITIONAL([WITH_WIN_ICON], [test "$with_windres" = "yes"]) ]) AC_DEFUN([LIBVIRT_WIN_RESULT_WINDRES], [ Pavel

On Wed, Dec 21, 2016 at 15:08:04 +0100, Pavel Hrdina wrote: > On Tue, Dec 20, 2016 at 01:41:11PM +0100, Jiri Denemark wrote: > > On Fri, Dec 16, 2016 at 10:11:01 +0100, Pavel Hrdina wrote: > > > Signed-off-by: Pavel Hrdina <phrdina@redhat.com> > > > --- > > > configure.ac | 11 ++--------- > > > m4/virt-win-windres.m4 | 34 ++++++++++++++++++++++++++++++++++ > > > 2 files changed, 36 insertions(+), 9 deletions(-) > > > create mode 100644 m4/virt-win-windres.m4 ... > diff --git a/m4/virt-win-windres.m4 b/m4/virt-win-windres.m4 > index c7b5d2a179..7f98c9fbff 100644 > --- a/m4/virt-win-windres.m4 > +++ b/m4/virt-win-windres.m4 > @@ -22,11 +22,12 @@ AC_DEFUN([LIBVIRT_WIN_CHECK_WINDRES], [ > with_windres=no > case "$host" in > *-*-mingw* | *-*-cygwin* | *-*-msvc* ) > - with_windres=yes > AC_CHECK_TOOL([WINDRES], [windres], []) > + if test "x$WINDRES" != "x"; then > + with_windres=yes > ;; > esac > - AM_CONDITIONAL([WITH_WIN_ICON], [test "$WINDRES" != ""]) > + AM_CONDITIONAL([WITH_WIN_ICON], [test "$with_windres" = "yes"]) > ]) > > AC_DEFUN([LIBVIRT_WIN_RESULT_WINDRES], [ ACK if you end the if statement with fi :-) Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index 99741a301a..2a0b71ba50 100644 --- a/configure.ac +++ b/configure.ac @@ -153,10 +153,23 @@ AC_MSG_RESULT([$LIBVIRT_NODELETE]) AC_SUBST([LIBVIRT_NODELETE]) AC_MSG_CHECKING([for how to set DSO symbol versions]) -VERSION_SCRIPT_FLAGS=-Wl,--version-script= -`$LD --help 2>&1 | grep -- --version-script >/dev/null` || \ - VERSION_SCRIPT_FLAGS="-Wl,-M -Wl," +case "$host" in + *-*-mingw* | *-*-msvc* ) + # mingw's ld has the --version-script parameter, but it requires a .def file + # instead to work properly, therefore clear --version-script here and use + # -Wl, to pass the .def file to the linker + # cygwin's ld has the --version-script parameter too, but for some reason + # it's working there as expected + VERSION_SCRIPT_FLAGS="-Wl," + ;; + * ) + VERSION_SCRIPT_FLAGS=-Wl,--version-script= + `$LD --help 2>&1 | grep -- --version-script >/dev/null` || \ + VERSION_SCRIPT_FLAGS="-Wl,-M -Wl," + ;; +esac AC_MSG_RESULT([$VERSION_SCRIPT_FLAGS]) +AC_SUBST([VERSION_SCRIPT_FLAGS]) dnl Specify if we rely on ifconfig instead of iproute2 (e.g. in case dnl we're working on BSD) @@ -1646,19 +1659,6 @@ LIBVIRT_WIN_CHECK_SYMBOLS LIBVIRT_WIN_CHECK_WINDRES -case "$host" in - *-*-mingw* | *-*-msvc* ) - # mingw's ld has the --version-script parameter, but it requires a .def file - # instead to work properly, therefore clear --version-script here and use - # -Wl, to pass the .def file to the linker - # cygwin's ld has the --version-script parameter too, but for some reason - # it's working there as expected - VERSION_SCRIPT_FLAGS="-Wl," - ;; -esac -AC_SUBST([VERSION_SCRIPT_FLAGS]) - - dnl Driver-Modules library support LIBVIRT_ARG_DRIVER_MODULES LIBVIRT_CHECK_DRIVER_MODULES -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:02 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 13 +------------ m4/virt-nwfilter.m4 | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 m4/virt-nwfilter.m4 diff --git a/configure.ac b/configure.ac index 2a0b71ba50..f6ec38bba9 100644 --- a/configure.ac +++ b/configure.ac @@ -284,6 +284,7 @@ LIBVIRT_CHECK_LIBSSH LIBVIRT_CHECK_NETCF LIBVIRT_CHECK_NSS LIBVIRT_CHECK_NUMACTL +LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_OPENWSMAN LIBVIRT_CHECK_PCIACCESS LIBVIRT_CHECK_READLINE @@ -1680,18 +1681,6 @@ then fi AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"]) -dnl nwfilter should only be compiled for linux, and only if the -dnl libvirt daemon is also being compiled - -with_nwfilter=yes -if test "$with_libvirtd" = "no" || test "$with_linux" != "yes"; then - with_nwfilter=no -fi -if test "$with_nwfilter" = "yes" ; then - AC_DEFINE([WITH_NWFILTER], 1, [whether local network filter management driver is available]) -fi -AM_CONDITIONAL([WITH_NWFILTER], [test "$with_nwfilter" = "yes"]) - dnl check if the interface driver should be compiled LIBVIRT_ARG_WITH([INTERFACE], [host interface driver], [check]) diff --git a/m4/virt-nwfilter.m4 b/m4/virt-nwfilter.m4 new file mode 100644 index 0000000000..759059cc8f --- /dev/null +++ b/m4/virt-nwfilter.m4 @@ -0,0 +1,32 @@ +dnl The nwfilter support +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_NWFILTER], [ + dnl nwfilter should only be compiled for linux, and only if the + dnl libvirt daemon is also being compiled + + with_nwfilter=yes + if test "$with_libvirtd" = "no" || test "$with_linux" != "yes"; then + with_nwfilter=no + fi + if test "$with_nwfilter" = "yes" ; then + AC_DEFINE([WITH_NWFILTER], 1, [whether local network filter management driver is available]) + fi + AM_CONDITIONAL([WITH_NWFILTER], [test "$with_nwfilter" = "yes"]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:03 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 13 +------------ m4/virt-nwfilter.m4 | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 m4/virt-nwfilter.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 18 +++--------------- m4/virt-pm-utils.m4 | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 15 deletions(-) create mode 100644 m4/virt-pm-utils.m4 diff --git a/configure.ac b/configure.ac index f6ec38bba9..1c115805b2 100644 --- a/configure.ac +++ b/configure.ac @@ -410,7 +410,7 @@ LIBVIRT_ARG_WITH_ALT([CHRDEV_LOCK_FILES], [location for UUCP style lock files for character devices ] [(use auto for default paths on some platforms)], [auto]) -LIBVIRT_ARG_WITH_ALT([PM_UTILS], [use pm-utils for power management], [check]) +LIBVIRT_ARG_PM_UTILS dnl dnl in case someone want to build static binaries @@ -1058,19 +1058,7 @@ AM_CONDITIONAL([WITH_PHYP],[test "$with_phyp" = "yes"]) dnl dnl Should we build with pm-utils support? dnl -if test "$with_pm_utils" = "check"; then - with_pm_utils=yes - if test "$with_dbus" = "yes"; then - if test "$init_systemd" = "yes"; then - with_pm_utils=no - fi - fi -fi - -if test "$with_pm_utils" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_PM_UTILS], 1, [whether to use pm-utils]) -fi -AM_CONDITIONAL([WITH_PM_UTILS], [test "$with_pm_utils" = "yes"]) +LIBVIRT_CHECK_PM_UTILS dnl check if the network driver should be compiled @@ -1962,6 +1950,7 @@ LIBVIRT_RESULT_NSS LIBVIRT_RESULT_NUMACTL LIBVIRT_RESULT_OPENWSMAN LIBVIRT_RESULT_PCIACCESS +LIBVIRT_RESULT_PM_UTILS LIBVIRT_RESULT_POLKIT LIBVIRT_RESULT_READLINE LIBVIRT_RESULT_SANLOCK @@ -1992,7 +1981,6 @@ AC_MSG_NOTICE([ rbd: $LIBRBD_LIBS]) else AC_MSG_NOTICE([ rbd: no]) fi -AC_MSG_NOTICE([pm-utils: $with_pm_utils]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Windows]) diff --git a/m4/virt-pm-utils.m4 b/m4/virt-pm-utils.m4 new file mode 100644 index 0000000000..654aba3cf3 --- /dev/null +++ b/m4/virt-pm-utils.m4 @@ -0,0 +1,45 @@ +dnl The pm-utils support check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_ARG_PM_UTILS], [ + LIBVIRT_ARG_WITH_ALT([PM_UTILS], [use pm-utils for power management], [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_PM_UTILS], [ + AC_REQUIRE([LIBVIRT_CHECK_DBUS]) + AC_REQUIRE([LIBVIRT_CHECK_INIT_SCRIPT]) + + if test "$with_pm_utils" = "check"; then + with_pm_utils=yes + if test "$with_dbus" = "yes"; then + if test "$init_systemd" = "yes"; then + with_pm_utils=no + fi + fi + fi + + if test "$with_pm_utils" = "yes"; then + AC_DEFINE_UNQUOTED([WITH_PM_UTILS], 1, [whether to use pm-utils]) + fi + AM_CONDITIONAL([WITH_PM_UTILS], [test "$with_pm_utils" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_RESULT_PM_UTILS], [ + LIBVIRT_RESULT_LIB([PM_UTILS]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:04 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 18 +++--------------- m4/virt-pm-utils.m4 | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 15 deletions(-) create mode 100644 m4/virt-pm-utils.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 20 ++------------------ m4/virt-devmapper.m4 | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 18 deletions(-) create mode 100644 m4/virt-devmapper.m4 diff --git a/configure.ac b/configure.ac index 1c115805b2..12f3f2fff1 100644 --- a/configure.ac +++ b/configure.ac @@ -111,7 +111,6 @@ fi dnl Required minimum versions of all libs we depend on PARTED_REQUIRED="1.8.0" -DEVMAPPER_REQUIRED=1.0.0 PARALLELS_SDK_REQUIRED="7.0.22" dnl Where we look for daemons and admin binaries during configure LIBVIRT_SBIN_PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin" @@ -1417,29 +1416,14 @@ AM_CONDITIONAL([WITH_STORAGE_DISK], [test "$with_storage_disk" = "yes"]) AC_SUBST([LIBPARTED_CFLAGS]) AC_SUBST([LIBPARTED_LIBS]) +LIBVIRT_CHECK_DEVMAPPER + if test "$with_storage_mpath" = "yes" || test "$with_storage_disk" = "yes"; then - DEVMAPPER_CFLAGS= - DEVMAPPER_LIBS= - PKG_CHECK_MODULES([DEVMAPPER], [devmapper >= $DEVMAPPER_REQUIRED], [], [DEVMAPPER_FOUND=no]) - if test "$DEVMAPPER_FOUND" = "no"; then - # devmapper is missing pkg-config files in ubuntu, suse, etc - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - DEVMAPPER_FOUND=yes - AC_CHECK_LIB([devmapper], [dm_task_run],,[DEVMAPPER_FOUND=no]) - DEVMAPPER_LIBS="-ldevmapper" - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - fi - AC_CHECK_HEADERS([libdevmapper.h],,[DEVMAPPER_FOUND=no]) if test "$DEVMAPPER_FOUND" = "no" ; then AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper >= $DEVMAPPER_REQUIRED to compile libvirt]) fi - fi -AC_SUBST([DEVMAPPER_CFLAGS]) -AC_SUBST([DEVMAPPER_LIBS]) with_storage=no for backend in dir fs lvm iscsi scsi mpath rbd disk; do diff --git a/m4/virt-devmapper.m4 b/m4/virt-devmapper.m4 new file mode 100644 index 0000000000..f0316ac434 --- /dev/null +++ b/m4/virt-devmapper.m4 @@ -0,0 +1,42 @@ +dnl The devmapper library +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_DEVMAPPER], [ + DEVMAPPER_REQUIRED=1.0.0 + DEVMAPPER_CFLAGS= + DEVMAPPER_LIBS= + + PKG_CHECK_MODULES([DEVMAPPER], [devmapper >= $DEVMAPPER_REQUIRED], [], [DEVMAPPER_FOUND=no]) + + if test "$DEVMAPPER_FOUND" = "no"; then + # devmapper is missing pkg-config files in ubuntu, suse, etc + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + DEVMAPPER_FOUND=yes + AC_CHECK_LIB([devmapper], [dm_task_run],,[DEVMAPPER_FOUND=no]) + DEVMAPPER_LIBS="-ldevmapper" + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + fi + + AC_CHECK_HEADERS([libdevmapper.h],,[DEVMAPPER_FOUND=no]) + + AC_SUBST([DEVMAPPER_CFLAGS]) + AC_SUBST([DEVMAPPER_LIBS]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:05 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 20 ++------------------ m4/virt-devmapper.m4 | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 18 deletions(-) create mode 100644 m4/virt-devmapper.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- config-post.h | 4 ++-- configure.ac | 2 +- m4/virt-devmapper.m4 | 23 ++++++----------------- src/util/virutil.c | 4 ++-- 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/config-post.h b/config-post.h index 6a91ff66b1..ffd0904dd2 100644 --- a/config-post.h +++ b/config-post.h @@ -26,7 +26,6 @@ */ #ifdef LIBVIRT_SETUID_RPC_CLIENT -# undef HAVE_LIBDEVMAPPER_H # undef HAVE_LIBNL # undef HAVE_LIBNL3 # undef HAVE_LIBSASL2 @@ -34,6 +33,7 @@ # undef WITH_CAPNG # undef WITH_CURL # undef WITH_DBUS +# undef WITH_DEVMAPPER # undef WITH_DTRACE_PROBES # undef WITH_GNUTLS # undef WITH_GNUTLS_GCRYPT @@ -53,13 +53,13 @@ * explanation above. */ #ifdef LIBVIRT_NSS -# undef HAVE_LIBDEVMAPPER_H # undef HAVE_LIBNL # undef HAVE_LIBNL3 # undef HAVE_LIBSASL2 # undef HAVE_SYS_ACL_H # undef WITH_CAPNG # undef WITH_CURL +# undef WITH_DEVMAPPER # undef WITH_DTRACE_PROBES # undef WITH_GNUTLS # undef WITH_GNUTLS_GCRYPT diff --git a/configure.ac b/configure.ac index 12f3f2fff1..b2812833ca 100644 --- a/configure.ac +++ b/configure.ac @@ -1420,7 +1420,7 @@ LIBVIRT_CHECK_DEVMAPPER if test "$with_storage_mpath" = "yes" || test "$with_storage_disk" = "yes"; then - if test "$DEVMAPPER_FOUND" = "no" ; then + if test "$with_devmapper" = "no" ; then AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper >= $DEVMAPPER_REQUIRED to compile libvirt]) fi fi diff --git a/m4/virt-devmapper.m4 b/m4/virt-devmapper.m4 index f0316ac434..2737b3eb2c 100644 --- a/m4/virt-devmapper.m4 +++ b/m4/virt-devmapper.m4 @@ -19,24 +19,13 @@ dnl AC_DEFUN([LIBVIRT_CHECK_DEVMAPPER], [ DEVMAPPER_REQUIRED=1.0.0 - DEVMAPPER_CFLAGS= - DEVMAPPER_LIBS= - PKG_CHECK_MODULES([DEVMAPPER], [devmapper >= $DEVMAPPER_REQUIRED], [], [DEVMAPPER_FOUND=no]) + with_devmapper=check - if test "$DEVMAPPER_FOUND" = "no"; then - # devmapper is missing pkg-config files in ubuntu, suse, etc - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - DEVMAPPER_FOUND=yes - AC_CHECK_LIB([devmapper], [dm_task_run],,[DEVMAPPER_FOUND=no]) - DEVMAPPER_LIBS="-ldevmapper" - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - fi - - AC_CHECK_HEADERS([libdevmapper.h],,[DEVMAPPER_FOUND=no]) + LIBVIRT_CHECK_PKG([DEVMAPPER], [devmapper], [$DEVMAPPER_REQUIRED], []) - AC_SUBST([DEVMAPPER_CFLAGS]) - AC_SUBST([DEVMAPPER_LIBS]) + if test "x$with_devmapper" = "xno"; then + with_devmapper=check + LIBVIRT_CHECK_LIB([DEVMAPPER], [devmapper], [dm_task_run], [libdevmapper.h]) + fi ]) diff --git a/src/util/virutil.c b/src/util/virutil.c index 02913787da..933d5b06b4 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -48,7 +48,7 @@ #include <termios.h> #include <locale.h> -#if HAVE_LIBDEVMAPPER_H +#if WITH_DEVMAPPER # include <libdevmapper.h> #endif @@ -1608,7 +1608,7 @@ void virFileWaitForDevices(void) {} #endif -#if HAVE_LIBDEVMAPPER_H +#if WITH_DEVMAPPER bool virIsDevMapperDevice(const char *dev_name) { -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:06 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- config-post.h | 4 ++-- configure.ac | 2 +- m4/virt-devmapper.m4 | 23 ++++++----------------- src/util/virutil.c | 4 ++-- 4 files changed, 11 insertions(+), 22 deletions(-) ... diff --git a/m4/virt-devmapper.m4 b/m4/virt-devmapper.m4 index f0316ac434..2737b3eb2c 100644 --- a/m4/virt-devmapper.m4 +++ b/m4/virt-devmapper.m4 @@ -19,24 +19,13 @@ dnl
AC_DEFUN([LIBVIRT_CHECK_DEVMAPPER], [ DEVMAPPER_REQUIRED=1.0.0 - DEVMAPPER_CFLAGS= - DEVMAPPER_LIBS=
- PKG_CHECK_MODULES([DEVMAPPER], [devmapper >= $DEVMAPPER_REQUIRED], [], [DEVMAPPER_FOUND=no]) + with_devmapper=check
- if test "$DEVMAPPER_FOUND" = "no"; then - # devmapper is missing pkg-config files in ubuntu, suse, etc - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - DEVMAPPER_FOUND=yes - AC_CHECK_LIB([devmapper], [dm_task_run],,[DEVMAPPER_FOUND=no]) - DEVMAPPER_LIBS="-ldevmapper" - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - fi - - AC_CHECK_HEADERS([libdevmapper.h],,[DEVMAPPER_FOUND=no]) + LIBVIRT_CHECK_PKG([DEVMAPPER], [devmapper], [$DEVMAPPER_REQUIRED], [])
- AC_SUBST([DEVMAPPER_CFLAGS]) - AC_SUBST([DEVMAPPER_LIBS]) + if test "x$with_devmapper" = "xno"; then
I think you should keep the "devmapper is missing pkg-config files in ubuntu, suse, etc" comment here.
+ with_devmapper=check + LIBVIRT_CHECK_LIB([DEVMAPPER], [devmapper], [dm_task_run], [libdevmapper.h]) + fi ])
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 21 ++------------------- m4/virt-parted.m4 | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 19 deletions(-) create mode 100644 m4/virt-parted.m4 diff --git a/configure.ac b/configure.ac index b2812833ca..56e40919a1 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,6 @@ then fi dnl Required minimum versions of all libs we depend on -PARTED_REQUIRED="1.8.0" PARALLELS_SDK_REQUIRED="7.0.22" dnl Where we look for daemons and admin binaries during configure LIBVIRT_SBIN_PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin" @@ -1376,22 +1375,10 @@ if test "$with_storage_fs" = "yes" || fi fi -LIBPARTED_CFLAGS= -LIBPARTED_LIBS= +LIBVIRT_CHECK_LIBPARTED + if test "$with_storage_disk" = "yes" || test "$with_storage_disk" = "check"; then - AC_PATH_PROG([PARTED], [parted], [], [$LIBVIRT_SBIN_PATH]) - if test -z "$PARTED" ; then - PARTED_FOUND=no - else - PARTED_FOUND=yes - fi - - if test "$PARTED_FOUND" = "yes" && test "x$PKG_CONFIG" != "x" ; then - PKG_CHECK_MODULES([LIBPARTED], [libparted >= $PARTED_REQUIRED], [], - [PARTED_FOUND=no]) - fi - if test "$with_storage_disk" = "yes" && test "$PARTED_FOUND" != "yes"; then AC_MSG_ERROR([Need parted for disk storage driver]) @@ -1408,13 +1395,9 @@ if test "$with_storage_disk" = "yes" || if test "$with_storage_disk" = "yes"; then AC_DEFINE_UNQUOTED([WITH_STORAGE_DISK], 1, [whether Disk backend for storage driver is enabled]) - AC_DEFINE_UNQUOTED([PARTED],["$PARTED"], - [Location or name of the parted program]) fi fi AM_CONDITIONAL([WITH_STORAGE_DISK], [test "$with_storage_disk" = "yes"]) -AC_SUBST([LIBPARTED_CFLAGS]) -AC_SUBST([LIBPARTED_LIBS]) LIBVIRT_CHECK_DEVMAPPER diff --git a/m4/virt-parted.m4 b/m4/virt-parted.m4 new file mode 100644 index 0000000000..a233ed75c9 --- /dev/null +++ b/m4/virt-parted.m4 @@ -0,0 +1,43 @@ +dnl The parted check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_LIBPARTED], [ + PARTED_REQUIRED="1.8.0" + LIBPARTED_CFLAGS= + LIBPARTED_LIBS= + + AC_PATH_PROG([PARTED], [parted], [], [$LIBVIRT_SBIN_PATH]) + if test -z "$PARTED" ; then + PARTED_FOUND=no + else + PARTED_FOUND=yes + fi + + if test "$PARTED_FOUND" = "yes" && test "x$PKG_CONFIG" != "x" ; then + PKG_CHECK_MODULES([LIBPARTED], [libparted >= $PARTED_REQUIRED], [], + [PARTED_FOUND=no]) + fi + + if test "$PARTED_FOUND" = "yes"; then + AC_DEFINE_UNQUOTED([PARTED], ["$PARTED"], + [Location or name of the parted program]) + fi + AC_SUBST([LIBPARTED_CFLAGS]) + AC_SUBST([LIBPARTED_LIBS]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:07 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 21 ++------------------- m4/virt-parted.m4 | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 19 deletions(-) create mode 100644 m4/virt-parted.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ++-- m4/virt-parted.m4 | 23 +++++++++-------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index 56e40919a1..1012735c22 100644 --- a/configure.ac +++ b/configure.ac @@ -1380,12 +1380,12 @@ LIBVIRT_CHECK_LIBPARTED if test "$with_storage_disk" = "yes" || test "$with_storage_disk" = "check"; then if test "$with_storage_disk" = "yes" && - test "$PARTED_FOUND" != "yes"; then + test "$with_libparted" != "yes"; then AC_MSG_ERROR([Need parted for disk storage driver]) fi if test "$with_storage_disk" = "check"; then - if test "$PARTED_FOUND" != "yes"; then + if test "$with_libparted" != "yes"; then with_storage_disk=no else with_storage_disk=yes diff --git a/m4/virt-parted.m4 b/m4/virt-parted.m4 index a233ed75c9..a73050a8b1 100644 --- a/m4/virt-parted.m4 +++ b/m4/virt-parted.m4 @@ -19,25 +19,20 @@ dnl AC_DEFUN([LIBVIRT_CHECK_LIBPARTED], [ PARTED_REQUIRED="1.8.0" - LIBPARTED_CFLAGS= - LIBPARTED_LIBS= - AC_PATH_PROG([PARTED], [parted], [], [$LIBVIRT_SBIN_PATH]) - if test -z "$PARTED" ; then - PARTED_FOUND=no - else - PARTED_FOUND=yes - fi + with_libparted=check + + LIBVIRT_CHECK_PKG([LIBPARTED], [libparted], [$PARTED_REQUIRED]) - if test "$PARTED_FOUND" = "yes" && test "x$PKG_CONFIG" != "x" ; then - PKG_CHECK_MODULES([LIBPARTED], [libparted >= $PARTED_REQUIRED], [], - [PARTED_FOUND=no]) + if test "x$with_libparted" = "xyes"; then + AC_PATH_PROG([PARTED], [parted], [], [$LIBVIRT_SBIN_PATH]) + if test -z "$PARTED" ; then + with_libparted=no + fi fi - if test "$PARTED_FOUND" = "yes"; then + if test "x$with_libparted" = "xyes"; then AC_DEFINE_UNQUOTED([PARTED], ["$PARTED"], [Location or name of the parted program]) fi - AC_SUBST([LIBPARTED_CFLAGS]) - AC_SUBST([LIBPARTED_LIBS]) ]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:08 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ++-- m4/virt-parted.m4 | 23 +++++++++-------------- 2 files changed, 11 insertions(+), 16 deletions(-)
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 75 +++++++++++++++++------------------------------------------- 1 file changed, 21 insertions(+), 54 deletions(-) diff --git a/configure.ac b/configure.ac index 1012735c22..85a8df1fe5 100644 --- a/configure.ac +++ b/configure.ac @@ -247,26 +247,34 @@ LIBVIRT_ARG_BLKID LIBVIRT_ARG_CAPNG LIBVIRT_ARG_CURL LIBVIRT_ARG_DBUS +LIBVIRT_ARG_FIREWALLD LIBVIRT_ARG_FUSE LIBVIRT_ARG_GLUSTER LIBVIRT_ARG_GNUTLS LIBVIRT_ARG_HAL +LIBVIRT_ARG_LIBPCAP LIBVIRT_ARG_LIBSSH +LIBVIRT_ARG_LIBXML +LIBVIRT_ARG_MACVTAP LIBVIRT_ARG_NETCF LIBVIRT_ARG_NSS LIBVIRT_ARG_NUMACTL LIBVIRT_ARG_OPENWSMAN LIBVIRT_ARG_PCIACCESS +LIBVIRT_ARG_PM_UTILS +LIBVIRT_ARG_POLKIT LIBVIRT_ARG_READLINE LIBVIRT_ARG_SANLOCK LIBVIRT_ARG_SASL LIBVIRT_ARG_SELINUX LIBVIRT_ARG_SSH2 LIBVIRT_ARG_UDEV +LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL LIBVIRT_CHECK_APPARMOR +LIBVIRT_CHECK_ATOMIC LIBVIRT_CHECK_ATTR LIBVIRT_CHECK_AUDIT LIBVIRT_CHECK_AVAHI @@ -274,24 +282,37 @@ LIBVIRT_CHECK_BLKID LIBVIRT_CHECK_CAPNG LIBVIRT_CHECK_CURL LIBVIRT_CHECK_DBUS +LIBVIRT_CHECK_DEVMAPPER +LIBVIRT_CHECK_DLOPEN +LIBVIRT_CHECK_FIREWALLD LIBVIRT_CHECK_FUSE LIBVIRT_CHECK_GLUSTER LIBVIRT_CHECK_GNUTLS LIBVIRT_CHECK_HAL +LIBVIRT_CHECK_LIBNL +LIBVIRT_CHECK_LIBPARTED +LIBVIRT_CHECK_LIBPCAP LIBVIRT_CHECK_LIBSSH +LIBVIRT_CHECK_LIBXML +LIBVIRT_CHECK_MACVTAP LIBVIRT_CHECK_NETCF LIBVIRT_CHECK_NSS LIBVIRT_CHECK_NUMACTL LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_OPENWSMAN LIBVIRT_CHECK_PCIACCESS +LIBVIRT_CHECK_PM_UTILS +LIBVIRT_CHECK_POLKIT +LIBVIRT_CHECK_PTHREAD LIBVIRT_CHECK_READLINE LIBVIRT_CHECK_SANLOCK LIBVIRT_CHECK_SASL LIBVIRT_CHECK_SELINUX LIBVIRT_CHECK_SSH2 LIBVIRT_CHECK_UDEV +LIBVIRT_CHECK_VIRTUALPORT LIBVIRT_CHECK_WIRESHARK +LIBVIRT_CHECK_XDR LIBVIRT_CHECK_YAJL AC_CHECK_SIZEOF([long]) @@ -303,8 +324,6 @@ AC_CHECK_FUNCS_ONCE([cfmakeraw fallocate geteuid getgid getgrnam_r \ posix_memalign prlimit regexec sched_getaffinity setgroups setns \ setrlimit symlink sysctlbyname getifaddrs sched_setscheduler unshare]) -LIBVIRT_CHECK_PTHREAD - dnl Availability of various common headers (non-fatal if missing). AC_CHECK_HEADERS([pwd.h regex.h sys/un.h \ sys/poll.h syslog.h mntent.h net/ethernet.h linux/magic.h \ @@ -322,9 +341,6 @@ fi AC_SUBST([ACL_CFLAGS]) AC_SUBST([ACL_LIBS]) -LIBVIRT_CHECK_ATOMIC - - AC_CHECK_TYPE([struct ifreq], [AC_DEFINE([HAVE_STRUCT_IFREQ],[1], [Defined if struct ifreq exists in net/if.h])], @@ -408,7 +424,6 @@ LIBVIRT_ARG_WITH_ALT([CHRDEV_LOCK_FILES], [location for UUCP style lock files for character devices ] [(use auto for default paths on some platforms)], [auto]) -LIBVIRT_ARG_PM_UTILS dnl dnl in case someone want to build static binaries @@ -478,20 +493,6 @@ AM_CONDITIONAL([WITH_VMWARE], [test "$with_vmware" = "yes"]) dnl -dnl check for XDR -dnl - -LIBVIRT_CHECK_XDR - - -dnl -dnl check for libdl -dnl - -LIBVIRT_CHECK_DLOPEN - - -dnl dnl check for VirtualBox XPCOMC location dnl @@ -870,10 +871,6 @@ dnl Need to test if pkg-config exists PKG_PROG_PKG_CONFIG -LIBVIRT_ARG_LIBXML -LIBVIRT_CHECK_LIBXML - - LIBVIRT_ARG_WITH_ALT([TLS_PRIORITY], [set the default TLS session priority string], [NORMAL]) @@ -882,13 +879,6 @@ AC_DEFINE_UNQUOTED([TLS_PRIORITY], ["$with_tls_priority"], [TLS default priority string]) -LIBVIRT_ARG_POLKIT -LIBVIRT_CHECK_POLKIT - -LIBVIRT_ARG_FIREWALLD -LIBVIRT_CHECK_FIREWALLD - - dnl UUCP style file locks for character devices if test "$with_chrdev_lock_files" != "no"; then case $with_chrdev_lock_files in @@ -1020,9 +1010,6 @@ if test "$with_numad" = "yes"; then fi AM_CONDITIONAL([HAVE_NUMAD], [test "$with_numad" != "no"]) -LIBVIRT_ARG_LIBPCAP -LIBVIRT_CHECK_LIBPCAP - dnl dnl Checks for the UML driver @@ -1053,11 +1040,6 @@ fi AM_CONDITIONAL([WITH_PHYP],[test "$with_phyp" = "yes"]) -dnl -dnl Should we build with pm-utils support? -dnl -LIBVIRT_CHECK_PM_UTILS - dnl check if the network driver should be compiled LIBVIRT_ARG_WITH_ALT([NETWORK], [with virtual network driver], [yes]) @@ -1375,8 +1357,6 @@ if test "$with_storage_fs" = "yes" || fi fi -LIBVIRT_CHECK_LIBPARTED - if test "$with_storage_disk" = "yes" || test "$with_storage_disk" = "check"; then if test "$with_storage_disk" = "yes" && @@ -1399,8 +1379,6 @@ if test "$with_storage_disk" = "yes" || fi AM_CONDITIONAL([WITH_STORAGE_DISK], [test "$with_storage_disk" = "yes"]) -LIBVIRT_CHECK_DEVMAPPER - if test "$with_storage_mpath" = "yes" || test "$with_storage_disk" = "yes"; then if test "$with_devmapper" = "no" ; then @@ -1687,20 +1665,9 @@ AC_PATH_PROG([QEMU_BRIDGE_HELPER], [qemu-bridge-helper], [/usr/libexec/qemu-brid [/usr/libexec:/usr/lib/qemu:/usr/lib]) AC_DEFINE_UNQUOTED([QEMU_BRIDGE_HELPER], ["$QEMU_BRIDGE_HELPER"], [QEMU bridge helper]) -LIBVIRT_ARG_MACVTAP -LIBVIRT_CHECK_MACVTAP - - -LIBVIRT_ARG_VIRTUALPORT -LIBVIRT_CHECK_VIRTUALPORT - dnl GET_VLAN_VID_CMD is required for virNetDevGetVLanID AC_CHECK_DECLS([GET_VLAN_VID_CMD], [], [], [[#include <linux/if_vlan.h>]]) -dnl netlink library - -LIBVIRT_CHECK_LIBNL - # Check for Linux vs. BSD ifreq members AC_CHECK_MEMBERS([struct ifreq.ifr_newname, struct ifreq.ifr_ifindex, -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:09 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 75 +++++++++++++++++------------------------------------------- 1 file changed, 21 insertions(+), 54 deletions(-)
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 23 +++-------------------- m4/virt-dtrace.m4 | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 20 deletions(-) create mode 100644 m4/virt-dtrace.m4 diff --git a/configure.ac b/configure.ac index 85a8df1fe5..4d35ea4cf8 100644 --- a/configure.ac +++ b/configure.ac @@ -959,25 +959,8 @@ if test "$with_apparmor" = "no"; then fi AM_CONDITIONAL([WITH_APPARMOR_PROFILES], [test "$with_apparmor_profiles" != "no"]) -dnl DTrace static probes -LIBVIRT_ARG_WITH_ALT([DTRACE], [use dtrace for static probing], [check]) - -if test "$with_dtrace" != "no" ; then - AC_PATH_PROG([DTRACE], [dtrace], [], [$LIBVIRT_SBIN_PATH]) - if test -z "$DTRACE" ; then - if test "$with_dtrace" = "check"; then - with_dtrace=no - else - AC_MSG_ERROR([You must install the 'dtrace' binary to enable libvirt static probes]) - fi - else - with_dtrace=yes - fi - if test "$with_dtrace" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_DTRACE_PROBES], 1, [whether DTrace static probes are available]) - fi -fi -AM_CONDITIONAL([WITH_DTRACE_PROBES], [test "$with_dtrace" != "no"]) +LIBVIRT_ARG_DTRACE +LIBVIRT_CHECK_DTRACE dnl numad @@ -1932,7 +1915,7 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([ Debug: $enable_debug]) AC_MSG_NOTICE([ Use -Werror: $enable_werror]) AC_MSG_NOTICE([ Warning Flags: $WARN_CFLAGS]) -AC_MSG_NOTICE([ DTrace: $with_dtrace]) +LIBVIRT_RESULT_DTRACE AC_MSG_NOTICE([ numad: $with_numad]) AC_MSG_NOTICE([ XML Catalog: $with_xml_catalog_file]) LIBVIRT_RESULT_INIT_SCRIPT diff --git a/m4/virt-dtrace.m4 b/m4/virt-dtrace.m4 new file mode 100644 index 0000000000..6dee416149 --- /dev/null +++ b/m4/virt-dtrace.m4 @@ -0,0 +1,45 @@ +dnl The DTrace static probes +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_ARG_DTRACE], [ + LIBVIRT_ARG_WITH_ALT([DTRACE], [use dtrace for static probing], [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_DTRACE], [ + if test "$with_dtrace" != "no" ; then + AC_PATH_PROG([DTRACE], [dtrace], [], [$LIBVIRT_SBIN_PATH]) + if test -z "$DTRACE" ; then + if test "$with_dtrace" = "check"; then + with_dtrace=no + else + AC_MSG_ERROR([You must install the 'dtrace' binary to enable libvirt static probes]) + fi + else + with_dtrace=yes + fi + if test "$with_dtrace" = "yes"; then + AC_DEFINE_UNQUOTED([WITH_DTRACE_PROBES], 1, [whether DTrace static probes are available]) + fi + fi + AM_CONDITIONAL([WITH_DTRACE_PROBES], [test "$with_dtrace" != "no"]) +]) + +AC_DEFUN([LIBVIRT_RESULT_DTRACE], [ + AC_MSG_NOTICE([ DTrace: $with_dtrace]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:10 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 23 +++-------------------- m4/virt-dtrace.m4 | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 20 deletions(-) create mode 100644 m4/virt-dtrace.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 32 +++---------------------------- m4/virt-numad.m4 | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 29 deletions(-) create mode 100644 m4/virt-numad.m4 diff --git a/configure.ac b/configure.ac index 4d35ea4cf8..f4c0672a50 100644 --- a/configure.ac +++ b/configure.ac @@ -964,34 +964,8 @@ LIBVIRT_CHECK_DTRACE dnl numad -LIBVIRT_ARG_WITH_ALT([NUMAD], [use numad to manage CPU placement dynamically], [check]) - -if test "$with_numad" != "no" ; then - fail=0 - - AC_PATH_PROG([NUMAD], [numad], [], [$LIBVIRT_SBIN_PATH]) - - if test "$with_numad" = "check"; then - test "$with_numactl" = "yes" || fail=1 - if test -z "$NUMAD" || test $fail = 1; then - with_numad="no" - else - with_numad="yes" - fi - else - test -z "$NUMAD" && - AC_MSG_ERROR([You must install numad package to manage CPU and memory placement dynamically]) - - test "$with_numactl" = "yes" || fail=1 - test $fail = 1 && - AC_MSG_ERROR([You must install the numactl development package in order to compile and run libvirt]) - fi -fi -if test "$with_numad" = "yes"; then - AC_DEFINE_UNQUOTED([HAVE_NUMAD], 1, [whether numad is available]) - AC_DEFINE_UNQUOTED([NUMAD],["$NUMAD"], [Location or name of the numad program]) -fi -AM_CONDITIONAL([HAVE_NUMAD], [test "$with_numad" != "no"]) +LIBVIRT_ARG_NUMAD +LIBVIRT_CHECK_NUMAD dnl @@ -1916,7 +1890,7 @@ AC_MSG_NOTICE([ Debug: $enable_debug]) AC_MSG_NOTICE([ Use -Werror: $enable_werror]) AC_MSG_NOTICE([ Warning Flags: $WARN_CFLAGS]) LIBVIRT_RESULT_DTRACE -AC_MSG_NOTICE([ numad: $with_numad]) +LIBVIRT_RESULT_NUMAD AC_MSG_NOTICE([ XML Catalog: $with_xml_catalog_file]) LIBVIRT_RESULT_INIT_SCRIPT AC_MSG_NOTICE([ Char device locks: $with_chrdev_lock_files]) diff --git a/m4/virt-numad.m4 b/m4/virt-numad.m4 new file mode 100644 index 0000000000..5df8cc699e --- /dev/null +++ b/m4/virt-numad.m4 @@ -0,0 +1,58 @@ +dnl The numad binary check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_ARG_NUMAD], [ + LIBVIRT_ARG_WITH_ALT([NUMAD], [use numad to manage CPU placement dynamically], + [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_NUMAD], [ + AC_REQUIRE([LIBVIRT_CHECK_NUMACTL]) + + if test "$with_numad" != "no" ; then + fail=0 + + AC_PATH_PROG([NUMAD], [numad], [], [$LIBVIRT_SBIN_PATH]) + + if test "$with_numad" = "check"; then + test "$with_numactl" = "yes" || fail=1 + if test -z "$NUMAD" || test $fail = 1; then + with_numad="no" + else + with_numad="yes" + fi + else + test -z "$NUMAD" && + AC_MSG_ERROR([You must install numad package to manage CPU and memory placement dynamically]) + + test "$with_numactl" = "yes" || fail=1 + test $fail = 1 && + AC_MSG_ERROR([You must install the numactl development package in order to compile and run libvirt]) + fi + fi + if test "$with_numad" = "yes"; then + AC_DEFINE_UNQUOTED([HAVE_NUMAD], 1, [whether numad is available]) + AC_DEFINE_UNQUOTED([NUMAD],["$NUMAD"], [Location or name of the numad program]) + fi + AM_CONDITIONAL([HAVE_NUMAD], [test "$with_numad" != "no"]) +]) + +AC_DEFUN([LIBVIRT_RESULT_NUMAD], [ + AC_MSG_NOTICE([ numad: $with_numad]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:11 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 32 +++---------------------------- m4/virt-numad.m4 | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 29 deletions(-) create mode 100644 m4/virt-numad.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 22 ++-------------------- m4/virt-sysctl.m4 | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 20 deletions(-) create mode 100644 m4/virt-sysctl.m4 diff --git a/configure.ac b/configure.ac index f4c0672a50..cf2269cde9 100644 --- a/configure.ac +++ b/configure.ac @@ -442,26 +442,8 @@ fi LIBVIRT_ARG_INIT_SCRIPT LIBVIRT_CHECK_INIT_SCRIPT -AC_MSG_CHECKING([for whether to install sysctl config]) -LIBVIRT_ARG_WITH_ALT([SYSCTL], [Whether to install sysctl configs], [check]) - -if test "$with_sysctl" = "yes" || test "$with_sysctl" = "check" -then - case $host in - *-*-linux*) - with_sysctl=yes - ;; - **) - if test "$with_sysctl" = "yes"; then - AC_MSG_ERROR([No sysctl configuration supported for $host]) - else - with_sysctl=no - fi - ;; - esac -fi -AM_CONDITIONAL([WITH_SYSCTL], test "$with_sysctl" = "yes") -AC_MSG_RESULT($with_sysctl) +LIBVIRT_ARG_SYSCTL_CONFIG +LIBVIRT_CHECK_SYSCTL_CONFIG dnl diff --git a/m4/virt-sysctl.m4 b/m4/virt-sysctl.m4 new file mode 100644 index 0000000000..7745d893f2 --- /dev/null +++ b/m4/virt-sysctl.m4 @@ -0,0 +1,43 @@ +dnl sysctl config check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_ARG_SYSCTL_CONFIG], [ + LIBVIRT_ARG_WITH_ALT([SYSCTL], [Whether to install sysctl configs], [check]) +]) + +AC_DEFUN([LIBVIRT_CHECK_SYSCTL_CONFIG], [ + AC_MSG_CHECKING([for whether to install sysctl config]) + if test "$with_sysctl" = "yes" || test "$with_sysctl" = "check" + then + case $host in + *-*-linux*) + with_sysctl=yes + ;; + **) + if test "$with_sysctl" = "yes"; then + AC_MSG_ERROR([No sysctl configuration supported for $host]) + else + with_sysctl=no + fi + ;; + esac + fi + AM_CONDITIONAL([WITH_SYSCTL], test "$with_sysctl" = "yes") + AC_MSG_RESULT($with_sysctl) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:12 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 22 ++-------------------- m4/virt-sysctl.m4 | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 20 deletions(-) create mode 100644 m4/virt-sysctl.m4 ... +AC_DEFUN([LIBVIRT_CHECK_SYSCTL_CONFIG], [ + AC_MSG_CHECKING([for whether to install sysctl config]) + if test "$with_sysctl" = "yes" || test "$with_sysctl" = "check" + then + case $host in + *-*-linux*) + with_sysctl=yes + ;; + **)
One star would be enough, but it's not your fault. ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 29 +++--------------------- m4/virt-chrdev-lock-files.m4 | 52 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 26 deletions(-) create mode 100644 m4/virt-chrdev-lock-files.m4 diff --git a/configure.ac b/configure.ac index cf2269cde9..89f3ab9bf8 100644 --- a/configure.ac +++ b/configure.ac @@ -420,10 +420,7 @@ LIBVIRT_ARG_WITH([TEST], [test driver], [yes]) LIBVIRT_ARG_WITH([REMOTE], [remote driver], [yes]) LIBVIRT_ARG_WITH([LIBVIRTD], [libvirtd], [yes]) -LIBVIRT_ARG_WITH_ALT([CHRDEV_LOCK_FILES], - [location for UUCP style lock files for character devices ] - [(use auto for default paths on some platforms)], - [auto]) +LIBVIRT_ARG_CHRDEV_LOCK_FILES dnl dnl in case someone want to build static binaries @@ -861,27 +858,7 @@ AC_DEFINE_UNQUOTED([TLS_PRIORITY], ["$with_tls_priority"], [TLS default priority string]) -dnl UUCP style file locks for character devices -if test "$with_chrdev_lock_files" != "no"; then - case $with_chrdev_lock_files in - yes | auto) - dnl Default locations for platforms, or disable if unknown - if test "$with_linux" = "yes"; then - with_chrdev_lock_files=/var/lock - elif test "$with_chrdev_lock_files" = "auto"; then - with_chrdev_lock_files=no - fi ;; - esac - if test "$with_chrdev_lock_files" = "yes"; then - AC_MSG_ERROR([You must specify path for the lock files on this -platform]) - fi - if test "$with_chrdev_lock_files" != "no"; then - AC_DEFINE_UNQUOTED([VIR_CHRDEV_LOCK_FILE_PATH], "$with_chrdev_lock_files", - [path to directory containing UUCP device lock files]) - fi -fi -AM_CONDITIONAL([VIR_CHRDEV_LOCK_FILE_PATH], [test "$with_chrdev_lock_files" != "no"]) +LIBVIRT_CHECK_CHRDEV_LOCK_FILES LIBVIRT_ARG_WITH_ALT([SECDRIVER_SELINUX], [use SELinux security driver], [check]) @@ -1875,7 +1852,7 @@ LIBVIRT_RESULT_DTRACE LIBVIRT_RESULT_NUMAD AC_MSG_NOTICE([ XML Catalog: $with_xml_catalog_file]) LIBVIRT_RESULT_INIT_SCRIPT -AC_MSG_NOTICE([ Char device locks: $with_chrdev_lock_files]) +LIBVIRT_RESULT_CHRDEV_LOCK_FILES AC_MSG_NOTICE([ Default Editor: $with_default_editor]) AC_MSG_NOTICE([ Loader/NVRAM: $with_loader_nvram]) LIBVIRT_RESULT_LOGIN_SHELL diff --git a/m4/virt-chrdev-lock-files.m4 b/m4/virt-chrdev-lock-files.m4 new file mode 100644 index 0000000000..8a44e4d457 --- /dev/null +++ b/m4/virt-chrdev-lock-files.m4 @@ -0,0 +1,52 @@ +dnl The locaton of UUCP style lock files +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_ARG_CHRDEV_LOCK_FILES], [ + LIBVIRT_ARG_WITH_ALT([CHRDEV_LOCK_FILES], + [location for UUCP style lock files for character devices ] + [(use auto for default paths on some platforms)], + [auto]) +]) + +AC_DEFUN([LIBVIRT_CHECK_CHRDEV_LOCK_FILES], [ + if test "$with_chrdev_lock_files" != "no"; then + case $with_chrdev_lock_files in + yes | auto) + dnl Default locations for platforms, or disable if unknown + if test "$with_linux" = "yes"; then + with_chrdev_lock_files=/var/lock + elif test "$with_chrdev_lock_files" = "auto"; then + with_chrdev_lock_files=no + fi + ;; + esac + if test "$with_chrdev_lock_files" = "yes"; then + AC_MSG_ERROR([You must specify path for the lock files on this platform]) + fi + if test "$with_chrdev_lock_files" != "no"; then + AC_DEFINE_UNQUOTED([VIR_CHRDEV_LOCK_FILE_PATH], "$with_chrdev_lock_files", + [path to directory containing UUCP device lock files]) + fi + fi + AM_CONDITIONAL([VIR_CHRDEV_LOCK_FILE_PATH], [test "$with_chrdev_lock_files" != "no"]) +]) + +AC_DEFUN([LIBVIRT_RESULT_CHRDEV_LOCK_FILES], [ + AC_MSG_NOTICE([ Char device locks: $with_chrdev_lock_files]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:13 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 29 +++--------------------- m4/virt-chrdev-lock-files.m4 | 52 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 26 deletions(-) create mode 100644 m4/virt-chrdev-lock-files.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 17 +++-------------- m4/virt-loader-nvram.m4 | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 14 deletions(-) create mode 100644 m4/virt-loader-nvram.m4 diff --git a/configure.ac b/configure.ac index 89f3ab9bf8..d6df45e0a9 100644 --- a/configure.ac +++ b/configure.ac @@ -1683,19 +1683,8 @@ AC_DEFINE_UNQUOTED([STATIC_ANALYSIS], [$t], LIBVIRT_ARG_WITH_ALT([DEFAULT_EDITOR], [Editor to use for interactive commands], [vi]) AC_DEFINE_UNQUOTED([DEFAULT_EDITOR], ["$with_default_editor"], [Default editor to use]) -LIBVIRT_ARG_WITH_ALT([LOADER_NVRAM], - [Pass list of pairs of <loader>:<nvram> paths. - Both pairs and list items are separated by a colon.], - ['']) -if test "x$with_loader_nvram" != "xno" && \ - test "x$with_loader_nvram" != "x" ; then - l=$(echo $with_loader_nvram | tr ':' '\n' | wc -l) - if test $(expr $l % 2) -ne 0 ; then - AC_MSG_ERROR([Malformed --with-loader-nvram argument]) - fi - AC_DEFINE_UNQUOTED([DEFAULT_LOADER_NVRAM], [$with_loader_nvram], - [List of loader:nvram pairs]) -fi +LIBVIRT_ARG_LOADER_NVRAM +LIBVIRT_CHECK_LOADER_NVRAM # Some GNULIB base64 symbols clash with a kerberos library AC_DEFINE_UNQUOTED([isbase64],[libvirt_gl_isbase64],[Hack to avoid symbol clash]) @@ -1854,7 +1843,7 @@ AC_MSG_NOTICE([ XML Catalog: $with_xml_catalog_file]) LIBVIRT_RESULT_INIT_SCRIPT LIBVIRT_RESULT_CHRDEV_LOCK_FILES AC_MSG_NOTICE([ Default Editor: $with_default_editor]) -AC_MSG_NOTICE([ Loader/NVRAM: $with_loader_nvram]) +LIBVIRT_RESULT_LOADER_NVRAM LIBVIRT_RESULT_LOGIN_SHELL LIBVIRT_RESULT_HOST_VALIDATE AC_MSG_NOTICE([ TLS priority: $with_tls_priority]) diff --git a/m4/virt-loader-nvram.m4 b/m4/virt-loader-nvram.m4 new file mode 100644 index 0000000000..e57ba829f4 --- /dev/null +++ b/m4/virt-loader-nvram.m4 @@ -0,0 +1,41 @@ +dnl The loader:nvram list check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_ARG_LOADER_NVRAM], [ + LIBVIRT_ARG_WITH_ALT([LOADER_NVRAM], + [Pass list of pairs of <loader>:<nvram> paths. + Both pairs and list items are separated by a colon.], + ['']) +]) + +AC_DEFUN([LIBVIRT_CHECK_LOADER_NVRAM], [ + if test "x$with_loader_nvram" != "xno" && \ + test "x$with_loader_nvram" != "x" ; then + l=$(echo $with_loader_nvram | tr ':' '\n' | wc -l) + if test $(expr $l % 2) -ne 0 ; then + AC_MSG_ERROR([Malformed --with-loader-nvram argument]) + fi + AC_DEFINE_UNQUOTED([DEFAULT_LOADER_NVRAM], [$with_loader_nvram], + [List of loader:nvram pairs]) + fi +]) + +AC_DEFUN([LIBVIRT_RESULT_LOADER_NVRAM], [ + AC_MSG_NOTICE([ Loader/NVRAM: $with_loader_nvram]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:14 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 17 +++-------------- m4/virt-loader-nvram.m4 | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 14 deletions(-) create mode 100644 m4/virt-loader-nvram.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 6 +++--- m4/virt-default-editor.m4 | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 m4/virt-default-editor.m4 diff --git a/configure.ac b/configure.ac index d6df45e0a9..71f9d7c831 100644 --- a/configure.ac +++ b/configure.ac @@ -1680,8 +1680,8 @@ test "x$lv_cv_static_analysis" = xyes && t=1 AC_DEFINE_UNQUOTED([STATIC_ANALYSIS], [$t], [Define to 1 when performing static analysis.]) -LIBVIRT_ARG_WITH_ALT([DEFAULT_EDITOR], [Editor to use for interactive commands], [vi]) -AC_DEFINE_UNQUOTED([DEFAULT_EDITOR], ["$with_default_editor"], [Default editor to use]) +LIBVIRT_ARG_DEFAULT_EDITOR +LIBVIRT_CHECK_DEFAULT_EDITOR LIBVIRT_ARG_LOADER_NVRAM LIBVIRT_CHECK_LOADER_NVRAM @@ -1842,7 +1842,7 @@ LIBVIRT_RESULT_NUMAD AC_MSG_NOTICE([ XML Catalog: $with_xml_catalog_file]) LIBVIRT_RESULT_INIT_SCRIPT LIBVIRT_RESULT_CHRDEV_LOCK_FILES -AC_MSG_NOTICE([ Default Editor: $with_default_editor]) +LIBVIRT_RESULT_DEFAULT_EDITOR LIBVIRT_RESULT_LOADER_NVRAM LIBVIRT_RESULT_LOGIN_SHELL LIBVIRT_RESULT_HOST_VALIDATE diff --git a/m4/virt-default-editor.m4 b/m4/virt-default-editor.m4 new file mode 100644 index 0000000000..0d50c35612 --- /dev/null +++ b/m4/virt-default-editor.m4 @@ -0,0 +1,32 @@ +dnl The default editor check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_ARG_DEFAULT_EDITOR], [ + LIBVIRT_ARG_WITH_ALT([DEFAULT_EDITOR], + [Editor to use for interactive commands], [vi]) +]) + +AC_DEFUN([LIBVIRT_CHECK_DEFAULT_EDITOR], [ + AC_DEFINE_UNQUOTED([DEFAULT_EDITOR], ["$with_default_editor"], + [Default editor to use]) +]) + +AC_DEFUN([LIBVIRT_RESULT_DEFAULT_EDITOR], [ + AC_MSG_NOTICE([ Default Editor: $with_default_editor]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:15 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 6 +++--- m4/virt-default-editor.m4 | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 m4/virt-default-editor.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 10 +++------- m4/virt-tls-priority.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 m4/virt-tls-priority.m4 diff --git a/configure.ac b/configure.ac index 71f9d7c831..2639848218 100644 --- a/configure.ac +++ b/configure.ac @@ -850,12 +850,8 @@ dnl Need to test if pkg-config exists PKG_PROG_PKG_CONFIG -LIBVIRT_ARG_WITH_ALT([TLS_PRIORITY], - [set the default TLS session priority string], - [NORMAL]) - -AC_DEFINE_UNQUOTED([TLS_PRIORITY], ["$with_tls_priority"], - [TLS default priority string]) +LIBVIRT_ARG_TLS_PRIORITY +LIBVIRT_CHECK_TLS_PRIORITY LIBVIRT_CHECK_CHRDEV_LOCK_FILES @@ -1846,7 +1842,7 @@ LIBVIRT_RESULT_DEFAULT_EDITOR LIBVIRT_RESULT_LOADER_NVRAM LIBVIRT_RESULT_LOGIN_SHELL LIBVIRT_RESULT_HOST_VALIDATE -AC_MSG_NOTICE([ TLS priority: $with_tls_priority]) +LIBVIRT_RESULT_TLS_PRIORITY AC_MSG_NOTICE([]) AC_MSG_NOTICE([Developer Tools]) AC_MSG_NOTICE([]) diff --git a/m4/virt-tls-priority.m4 b/m4/virt-tls-priority.m4 new file mode 100644 index 0000000000..1c3539efc6 --- /dev/null +++ b/m4/virt-tls-priority.m4 @@ -0,0 +1,33 @@ +dnl The TLS priority check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_ARG_TLS_PRIORITY], [ + LIBVIRT_ARG_WITH_ALT([TLS_PRIORITY], + [set the default TLS session priority string], + [NORMAL]) +]) + +AC_DEFUN([LIBVIRT_CHECK_TLS_PRIORITY], [ + AC_DEFINE_UNQUOTED([TLS_PRIORITY], ["$with_tls_priority"], + [TLS default priority string]) +]) + +AC_DEFUN([LIBVIRT_RESULT_TLS_PRIORITY], [ + LIBVIRT_RESULT([TLS priority], [$with_tls_priority]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:16 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 10 +++------- m4/virt-tls-priority.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 m4/virt-tls-priority.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 9 +++------ m4/virt-xml-catalog.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 m4/virt-xml-catalog.m4 diff --git a/configure.ac b/configure.ac index 2639848218..ba20bd3d68 100644 --- a/configure.ac +++ b/configure.ac @@ -386,11 +386,8 @@ else fi AC_SUBST([HTML_DIR]) -dnl Specific XML catalog file for validation of generated html -LIBVIRT_ARG_WITH_ALT([XML_CATALOG_FILE], - [path to XML catalog file for validating generated html], - ['/etc/xml/catalog']) -AC_SUBST([XML_CATALOG_FILE], [$with_xml_catalog_file]) +LIBVIRT_ARG_XML_CATALOG +LIBVIRT_CHECK_XML_CATALOG dnl if --prefix is /usr, don't use /usr/var for localstatedir dnl or /usr/etc for sysconfdir @@ -1835,7 +1832,7 @@ AC_MSG_NOTICE([ Use -Werror: $enable_werror]) AC_MSG_NOTICE([ Warning Flags: $WARN_CFLAGS]) LIBVIRT_RESULT_DTRACE LIBVIRT_RESULT_NUMAD -AC_MSG_NOTICE([ XML Catalog: $with_xml_catalog_file]) +LIBVIRT_RESULT_XML_CATALOG LIBVIRT_RESULT_INIT_SCRIPT LIBVIRT_RESULT_CHRDEV_LOCK_FILES LIBVIRT_RESULT_DEFAULT_EDITOR diff --git a/m4/virt-xml-catalog.m4 b/m4/virt-xml-catalog.m4 new file mode 100644 index 0000000000..c75476dc3d --- /dev/null +++ b/m4/virt-xml-catalog.m4 @@ -0,0 +1,33 @@ +dnl The XML catalog file check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_ARG_XML_CATALOG], [ + LIBVIRT_ARG_WITH_ALT([XML_CATALOG_FILE], + [path to XML catalog file for validating generated html], + ['/etc/xml/catalog']) +]) + +AC_DEFUN([LIBVIRT_CHECK_XML_CATALOG], [ + dnl Specific XML catalog file for validation of generated html + AC_SUBST([XML_CATALOG_FILE], [$with_xml_catalog_file]) +]) + +AC_DEFUN([LIBVIRT_RESULT_XML_CATALOG], [ + AC_MSG_NOTICE([ XML Catalog: $with_xml_catalog_file]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:17 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 9 +++------ m4/virt-xml-catalog.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 m4/virt-xml-catalog.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 9 +++------ m4/virt-debug.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 m4/virt-debug.m4 diff --git a/configure.ac b/configure.ac index ba20bd3d68..67a81965d5 100644 --- a/configure.ac +++ b/configure.ac @@ -427,11 +427,8 @@ STATIC_BINARIES= AC_SUBST([STATIC_BINARIES]) dnl --enable-debug=(yes|no) -LIBVIRT_ARG_ENABLE([DEBUG], [enable debugging output], [yes]) -AM_CONDITIONAL([ENABLE_DEBUG], test x"$enable_debug" = x"yes") -if test x"$enable_debug" = x"yes"; then - AC_DEFINE([ENABLE_DEBUG], [], [whether debugging is enabled]) -fi +LIBVIRT_ARG_DEBUG +LIBVIRT_CHECK_DEBUG LIBVIRT_ARG_INIT_SCRIPT LIBVIRT_CHECK_INIT_SCRIPT @@ -1827,7 +1824,7 @@ AC_MSG_NOTICE([ Alloc OOM: $enable_oom]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Miscellaneous]) AC_MSG_NOTICE([]) -AC_MSG_NOTICE([ Debug: $enable_debug]) +LIBVIRT_RESULT_DEBUG AC_MSG_NOTICE([ Use -Werror: $enable_werror]) AC_MSG_NOTICE([ Warning Flags: $WARN_CFLAGS]) LIBVIRT_RESULT_DTRACE diff --git a/m4/virt-debug.m4 b/m4/virt-debug.m4 new file mode 100644 index 0000000000..d03cf10255 --- /dev/null +++ b/m4/virt-debug.m4 @@ -0,0 +1,33 @@ +dnl The debug check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_ARG_DEBUG], [ + LIBVIRT_ARG_ENABLE([DEBUG], [enable debugging output], [yes]) +]) + +AC_DEFUN([LIBVIRT_CHECK_DEBUG], [ + AM_CONDITIONAL([ENABLE_DEBUG], test x"$enable_debug" = x"yes") + if test x"$enable_debug" = x"yes"; then + AC_DEFINE([ENABLE_DEBUG], [], [whether debugging is enabled]) + fi +]) + +AC_DEFUN([LIBVIRT_RESULT_DEBUG], [ + AC_MSG_NOTICE([ Debug: $enable_debug]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:18 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 9 +++------ m4/virt-debug.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 m4/virt-debug.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 72 ++++++++++++++++++++++-------------------------------------- 1 file changed, 26 insertions(+), 46 deletions(-) diff --git a/configure.ac b/configure.ac index 67a81965d5..9173f91517 100644 --- a/configure.ac +++ b/configure.ac @@ -386,9 +386,6 @@ else fi AC_SUBST([HTML_DIR]) -LIBVIRT_ARG_XML_CATALOG -LIBVIRT_CHECK_XML_CATALOG - dnl if --prefix is /usr, don't use /usr/var for localstatedir dnl or /usr/etc for sysconfdir dnl as this makes a lot of things break in testing situations @@ -417,8 +414,6 @@ LIBVIRT_ARG_WITH([TEST], [test driver], [yes]) LIBVIRT_ARG_WITH([REMOTE], [remote driver], [yes]) LIBVIRT_ARG_WITH([LIBVIRTD], [libvirtd], [yes]) -LIBVIRT_ARG_CHRDEV_LOCK_FILES - dnl dnl in case someone want to build static binaries dnl STATIC_BINARIES="-static" @@ -426,14 +421,35 @@ dnl STATIC_BINARIES= AC_SUBST([STATIC_BINARIES]) -dnl --enable-debug=(yes|no) -LIBVIRT_ARG_DEBUG -LIBVIRT_CHECK_DEBUG +dnl +dnl Miscellaneous checks +dnl +LIBVIRT_ARG_DEBUG +LIBVIRT_ARG_DTRACE +LIBVIRT_ARG_NUMAD +LIBVIRT_ARG_XML_CATALOG LIBVIRT_ARG_INIT_SCRIPT -LIBVIRT_CHECK_INIT_SCRIPT - +LIBVIRT_ARG_CHRDEV_LOCK_FILES +LIBVIRT_ARG_DEFAULT_EDITOR +LIBVIRT_ARG_LOADER_NVRAM +LIBVIRT_ARG_LOGIN_SHELL +LIBVIRT_ARG_HOST_VALIDATE +LIBVIRT_ARG_TLS_PRIORITY LIBVIRT_ARG_SYSCTL_CONFIG + + +LIBVIRT_CHECK_DEBUG +LIBVIRT_CHECK_DTRACE +LIBVIRT_CHECK_NUMAD +LIBVIRT_CHECK_XML_CATALOG +LIBVIRT_CHECK_INIT_SCRIPT +LIBVIRT_CHECK_CHRDEV_LOCK_FILES +LIBVIRT_CHECK_DEFAULT_EDITOR +LIBVIRT_CHECK_LOADER_NVRAM +LIBVIRT_CHECK_LOGIN_SHELL +LIBVIRT_CHECK_HOST_VALIDATE +LIBVIRT_CHECK_TLS_PRIORITY LIBVIRT_CHECK_SYSCTL_CONFIG @@ -769,20 +785,6 @@ if test "$with_lxc" = "yes" ; then fi AM_CONDITIONAL([WITH_LXC], [test "$with_lxc" = "yes"]) -dnl -dnl Check for virt-login-shell -dnl - -LIBVIRT_ARG_LOGIN_SHELL -LIBVIRT_CHECK_LOGIN_SHELL - -dnl -dnl Check for virt-host-validate -dnl - -LIBVIRT_ARG_HOST_VALIDATE -LIBVIRT_CHECK_HOST_VALIDATE - AM_CONDITIONAL([WITH_SETUID_RPC_CLIENT], [test "$with_lxc$with_login_shell" != "nono"]) dnl @@ -844,13 +846,6 @@ dnl Need to test if pkg-config exists PKG_PROG_PKG_CONFIG -LIBVIRT_ARG_TLS_PRIORITY -LIBVIRT_CHECK_TLS_PRIORITY - - -LIBVIRT_CHECK_CHRDEV_LOCK_FILES - - LIBVIRT_ARG_WITH_ALT([SECDRIVER_SELINUX], [use SELinux security driver], [check]) if test "$with_selinux" != "yes" ; then @@ -908,15 +903,6 @@ if test "$with_apparmor" = "no"; then fi AM_CONDITIONAL([WITH_APPARMOR_PROFILES], [test "$with_apparmor_profiles" != "no"]) -LIBVIRT_ARG_DTRACE -LIBVIRT_CHECK_DTRACE - - -dnl numad -LIBVIRT_ARG_NUMAD -LIBVIRT_CHECK_NUMAD - - dnl dnl Checks for the UML driver dnl @@ -1670,12 +1656,6 @@ test "x$lv_cv_static_analysis" = xyes && t=1 AC_DEFINE_UNQUOTED([STATIC_ANALYSIS], [$t], [Define to 1 when performing static analysis.]) -LIBVIRT_ARG_DEFAULT_EDITOR -LIBVIRT_CHECK_DEFAULT_EDITOR - -LIBVIRT_ARG_LOADER_NVRAM -LIBVIRT_CHECK_LOADER_NVRAM - # Some GNULIB base64 symbols clash with a kerberos library AC_DEFINE_UNQUOTED([isbase64],[libvirt_gl_isbase64],[Hack to avoid symbol clash]) AC_DEFINE_UNQUOTED([base64_encode],[libvirt_gl_base64_encode],[Hack to avoid symbol clash]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:19 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 72 ++++++++++++++++++++++-------------------------------------- 1 file changed, 26 insertions(+), 46 deletions(-)
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 22 +++------------------- m4/virt-driver-openvz.m4 | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 19 deletions(-) create mode 100644 m4/virt-driver-openvz.m4 diff --git a/configure.ac b/configure.ac index 9173f91517..5879444da0 100644 --- a/configure.ac +++ b/configure.ac @@ -401,7 +401,7 @@ dnl Allow to build without Xen, QEMU/KVM, test or remote driver LIBVIRT_ARG_WITH([XEN], [XEN], [check]) LIBVIRT_ARG_WITH([XEN_INOTIFY], [XEN inotify], [check]) LIBVIRT_ARG_WITH([QEMU], [QEMU/KVM], [yes]) -LIBVIRT_ARG_WITH([OPENVZ], [OpenVZ], [check]) +LIBVIRT_DRIVER_ARG_OPENVZ LIBVIRT_ARG_WITH([VMWARE], [VMware], [yes]) LIBVIRT_ARG_WITH([PHYP], [PHYP], [check]) LIBVIRT_ARG_WITH([XENAPI], [XenAPI], [check]) @@ -453,23 +453,7 @@ LIBVIRT_CHECK_TLS_PRIORITY LIBVIRT_CHECK_SYSCTL_CONFIG -dnl -dnl Checks for the OpenVZ driver -dnl - -if test "$with_openvz" = "check"; then - with_openvz=$with_linux -fi - -if test "$with_openvz" = "yes" && test "$with_linux" = "no"; then - AC_MSG_ERROR([The OpenVZ driver can be enabled on Linux only.]) -fi - -if test "$with_openvz" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_OPENVZ], 1, [whether OpenVZ driver is enabled]) -fi -AM_CONDITIONAL([WITH_OPENVZ], [test "$with_openvz" = "yes"]) - +LIBVIRT_DRIVER_CHECK_OPENVZ dnl dnl Checks for the VMware Workstation/Player driver @@ -1692,7 +1676,7 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([ Xen: $with_xen]) AC_MSG_NOTICE([ QEMU: $with_qemu]) LIBVIRT_DRIVER_RESULT_UML -AC_MSG_NOTICE([ OpenVZ: $with_openvz]) +LIBVIRT_DRIVER_RESULT_OPENVZ AC_MSG_NOTICE([ VMware: $with_vmware]) AC_MSG_NOTICE([ VBox: $with_vbox]) AC_MSG_NOTICE([ XenAPI: $with_xenapi]) diff --git a/m4/virt-driver-openvz.m4 b/m4/virt-driver-openvz.m4 new file mode 100644 index 0000000000..bd00f69679 --- /dev/null +++ b/m4/virt-driver-openvz.m4 @@ -0,0 +1,42 @@ +dnl The OpenVZ driver +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_DRIVER_ARG_OPENVZ], [ + LIBVIRT_ARG_WITH([OPENVZ], [OpenVZ], [check]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_CHECK_OPENVZ], [ + if test "$with_openvz" = "check"; then + with_openvz=$with_linux + fi + + if test "$with_openvz" = "yes" && test "$with_linux" = "no"; then + AC_MSG_ERROR([The OpenVZ driver can be enabled on Linux only.]) + fi + + if test "$with_openvz" = "yes"; then + AC_DEFINE_UNQUOTED([WITH_OPENVZ], 1, [whether OpenVZ driver is enabled]) + fi + + AM_CONDITIONAL([WITH_OPENVZ], [test "$with_openvz" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_RESULT_OPENVZ], [ + LIBVIRT_RESULT([OpenVZ], [$with_openvz]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:20 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 22 +++------------------- m4/virt-driver-openvz.m4 | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 19 deletions(-) create mode 100644 m4/virt-driver-openvz.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 15 +++------------ m4/virt-driver-vmware.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 m4/virt-driver-vmware.m4 diff --git a/configure.ac b/configure.ac index 5879444da0..278604bf1b 100644 --- a/configure.ac +++ b/configure.ac @@ -402,7 +402,7 @@ LIBVIRT_ARG_WITH([XEN], [XEN], [check]) LIBVIRT_ARG_WITH([XEN_INOTIFY], [XEN inotify], [check]) LIBVIRT_ARG_WITH([QEMU], [QEMU/KVM], [yes]) LIBVIRT_DRIVER_ARG_OPENVZ -LIBVIRT_ARG_WITH([VMWARE], [VMware], [yes]) +LIBVIRT_DRIVER_ARG_VMWARE LIBVIRT_ARG_WITH([PHYP], [PHYP], [check]) LIBVIRT_ARG_WITH([XENAPI], [XenAPI], [check]) LIBVIRT_ARG_WITH([LIBXL], [libxenlight], [check]) @@ -454,16 +454,7 @@ LIBVIRT_CHECK_SYSCTL_CONFIG LIBVIRT_DRIVER_CHECK_OPENVZ - -dnl -dnl Checks for the VMware Workstation/Player driver -dnl - -if test "$with_vmware" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_VMWARE], 1, [whether VMware driver is enabled]) -fi -AM_CONDITIONAL([WITH_VMWARE], [test "$with_vmware" = "yes"]) - +LIBVIRT_DRIVER_CHECK_VMWARE dnl dnl check for VirtualBox XPCOMC location @@ -1677,7 +1668,7 @@ AC_MSG_NOTICE([ Xen: $with_xen]) AC_MSG_NOTICE([ QEMU: $with_qemu]) LIBVIRT_DRIVER_RESULT_UML LIBVIRT_DRIVER_RESULT_OPENVZ -AC_MSG_NOTICE([ VMware: $with_vmware]) +LIBVIRT_DRIVER_RESULT_VMWARE AC_MSG_NOTICE([ VBox: $with_vbox]) AC_MSG_NOTICE([ XenAPI: $with_xenapi]) AC_MSG_NOTICE([ xenlight: $with_libxl]) diff --git a/m4/virt-driver-vmware.m4 b/m4/virt-driver-vmware.m4 new file mode 100644 index 0000000000..ed73087b90 --- /dev/null +++ b/m4/virt-driver-vmware.m4 @@ -0,0 +1,33 @@ +dnl The VMware driver check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_DRIVER_ARG_VMWARE], [ + LIBVIRT_ARG_WITH([VMWARE], [VMware], [yes]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_CHECK_VMWARE], [ + if test "$with_vmware" = "yes"; then + AC_DEFINE_UNQUOTED([WITH_VMWARE], 1, [whether VMware driver is enabled]) + fi + AM_CONDITIONAL([WITH_VMWARE], [test "$with_vmware" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_RESULT_VMWARE], [ + LIBVIRT_RESULT([VMware], [$with_vmware]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:21 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 15 +++------------ m4/virt-driver-vmware.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 m4/virt-driver-vmware.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 9 +++------ m4/virt-driver-qemu.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 m4/virt-driver-qemu.m4 diff --git a/configure.ac b/configure.ac index 278604bf1b..588a82828f 100644 --- a/configure.ac +++ b/configure.ac @@ -400,7 +400,7 @@ fi dnl Allow to build without Xen, QEMU/KVM, test or remote driver LIBVIRT_ARG_WITH([XEN], [XEN], [check]) LIBVIRT_ARG_WITH([XEN_INOTIFY], [XEN inotify], [check]) -LIBVIRT_ARG_WITH([QEMU], [QEMU/KVM], [yes]) +LIBVIRT_DRIVER_ARG_QEMU LIBVIRT_DRIVER_ARG_OPENVZ LIBVIRT_DRIVER_ARG_VMWARE LIBVIRT_ARG_WITH([PHYP], [PHYP], [check]) @@ -476,10 +476,7 @@ if test "x$with_vbox" = "xyes"; then fi AM_CONDITIONAL([WITH_VBOX], [test "$with_vbox" = "yes"]) -if test "$with_qemu" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_QEMU], 1, [whether QEMU driver is enabled]) -fi -AM_CONDITIONAL([WITH_QEMU], [test "$with_qemu" = "yes"]) +LIBVIRT_DRIVER_CHECK_QEMU if test "$with_test" = "yes" ; then AC_DEFINE_UNQUOTED([WITH_TEST], 1, [whether Test driver is enabled]) @@ -1665,7 +1662,7 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Drivers]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([ Xen: $with_xen]) -AC_MSG_NOTICE([ QEMU: $with_qemu]) +LIBVIRT_DRIVER_RESULT_QEMU LIBVIRT_DRIVER_RESULT_UML LIBVIRT_DRIVER_RESULT_OPENVZ LIBVIRT_DRIVER_RESULT_VMWARE diff --git a/m4/virt-driver-qemu.m4 b/m4/virt-driver-qemu.m4 new file mode 100644 index 0000000000..39ec73bfef --- /dev/null +++ b/m4/virt-driver-qemu.m4 @@ -0,0 +1,33 @@ +dnl The QEMU driver +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_DRIVER_ARG_QEMU], [ + LIBVIRT_ARG_WITH([QEMU], [QEMU/KVM], [yes]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_CHECK_QEMU], [ + if test "$with_qemu" = "yes" ; then + AC_DEFINE_UNQUOTED([WITH_QEMU], 1, [whether QEMU driver is enabled]) + fi + AM_CONDITIONAL([WITH_QEMU], [test "$with_qemu" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_RESULT_QEMU], [ + LIBVIRT_RESULT([QEMU], [$with_qemu]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:22 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 9 +++------ m4/virt-driver-qemu.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 m4/virt-driver-qemu.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 27 +-------------------------- m4/virt-driver-qemu.m4 | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/configure.ac b/configure.ac index 588a82828f..b41aad4905 100644 --- a/configure.ac +++ b/configure.ac @@ -1500,31 +1500,6 @@ fi AM_CONDITIONAL([WITH_INTERFACE], [test "$with_interface" = "yes"]) -if test $with_freebsd = yes || test $with_osx = yes; then - default_qemu_user=root - default_qemu_group=wheel -else - default_qemu_user=root - default_qemu_group=root -fi - -LIBVIRT_ARG_WITH_ALT([QEMU_USER], [username to run QEMU system instance as], - ['platform dependent']) -LIBVIRT_ARG_WITH_ALT([QEMU_GROUP], [groupname to run QEMU system instance as], - ['platform dependent']) -if test "x$with_qemu_user" = "xplatform dependent" ; then - QEMU_USER="$default_qemu_user" -else - QEMU_USER="$with_qemu_user" -fi -if test "x$with_qemu_group" = "xplatform dependent" ; then - QEMU_GROUP="$default_qemu_group" -else - QEMU_GROUP="$with_qemu_group" -fi -AC_DEFINE_UNQUOTED([QEMU_USER], ["$QEMU_USER"], [QEMU user account]) -AC_DEFINE_UNQUOTED([QEMU_GROUP], ["$QEMU_GROUP"], [QEMU group account]) - AC_PATH_PROG([QEMU_BRIDGE_HELPER], [qemu-bridge-helper], [/usr/libexec/qemu-bridge-helper], [/usr/libexec:/usr/lib/qemu:/usr/lib]) AC_DEFINE_UNQUOTED([QEMU_BRIDGE_HELPER], ["$QEMU_BRIDGE_HELPER"], [QEMU bridge helper]) @@ -1796,5 +1771,5 @@ LIBVIRT_RESULT_WIRESHARK AC_MSG_NOTICE([]) AC_MSG_NOTICE([Privileges]) AC_MSG_NOTICE([]) -AC_MSG_NOTICE([ QEMU: $QEMU_USER:$QEMU_GROUP]) +LIBVIRT_RESULT_QEMU_PRIVILEGES AC_MSG_NOTICE([]) diff --git a/m4/virt-driver-qemu.m4 b/m4/virt-driver-qemu.m4 index 39ec73bfef..9e65e85364 100644 --- a/m4/virt-driver-qemu.m4 +++ b/m4/virt-driver-qemu.m4 @@ -19,6 +19,10 @@ dnl AC_DEFUN([LIBVIRT_DRIVER_ARG_QEMU], [ LIBVIRT_ARG_WITH([QEMU], [QEMU/KVM], [yes]) + LIBVIRT_ARG_WITH_ALT([QEMU_USER], [username to run QEMU system instance as], + ['platform dependent']) + LIBVIRT_ARG_WITH_ALT([QEMU_GROUP], [groupname to run QEMU system instance as], + ['platform dependent']) ]) AC_DEFUN([LIBVIRT_DRIVER_CHECK_QEMU], [ @@ -26,8 +30,33 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_QEMU], [ AC_DEFINE_UNQUOTED([WITH_QEMU], 1, [whether QEMU driver is enabled]) fi AM_CONDITIONAL([WITH_QEMU], [test "$with_qemu" = "yes"]) + + if test $with_freebsd = yes || test $with_osx = yes; then + default_qemu_user=root + default_qemu_group=wheel + else + default_qemu_user=root + default_qemu_group=root + fi + + if test "x$with_qemu_user" = "xplatform dependent" ; then + QEMU_USER="$default_qemu_user" + else + QEMU_USER="$with_qemu_user" + fi + if test "x$with_qemu_group" = "xplatform dependent" ; then + QEMU_GROUP="$default_qemu_group" + else + QEMU_GROUP="$with_qemu_group" + fi + AC_DEFINE_UNQUOTED([QEMU_USER], ["$QEMU_USER"], [QEMU user account]) + AC_DEFINE_UNQUOTED([QEMU_GROUP], ["$QEMU_GROUP"], [QEMU group account]) ]) AC_DEFUN([LIBVIRT_DRIVER_RESULT_QEMU], [ LIBVIRT_RESULT([QEMU], [$with_qemu]) ]) + +AC_DEFUN([LIBVIRT_RESULT_QEMU_PRIVILEGES], [ + LIBVIRT_RESULT([QEMU], [$QEMU_USER:$QEMU_GROUP]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:23 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 27 +-------------------------- m4/virt-driver-qemu.m4 | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 26 deletions(-)
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ---- m4/virt-driver-qemu.m4 | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index b41aad4905..7713dab82f 100644 --- a/configure.ac +++ b/configure.ac @@ -1500,10 +1500,6 @@ fi AM_CONDITIONAL([WITH_INTERFACE], [test "$with_interface" = "yes"]) -AC_PATH_PROG([QEMU_BRIDGE_HELPER], [qemu-bridge-helper], [/usr/libexec/qemu-bridge-helper], - [/usr/libexec:/usr/lib/qemu:/usr/lib]) -AC_DEFINE_UNQUOTED([QEMU_BRIDGE_HELPER], ["$QEMU_BRIDGE_HELPER"], [QEMU bridge helper]) - dnl GET_VLAN_VID_CMD is required for virNetDevGetVLanID AC_CHECK_DECLS([GET_VLAN_VID_CMD], [], [], [[#include <linux/if_vlan.h>]]) diff --git a/m4/virt-driver-qemu.m4 b/m4/virt-driver-qemu.m4 index 9e65e85364..6586be0b15 100644 --- a/m4/virt-driver-qemu.m4 +++ b/m4/virt-driver-qemu.m4 @@ -51,6 +51,12 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_QEMU], [ fi AC_DEFINE_UNQUOTED([QEMU_USER], ["$QEMU_USER"], [QEMU user account]) AC_DEFINE_UNQUOTED([QEMU_GROUP], ["$QEMU_GROUP"], [QEMU group account]) + + AC_PATH_PROG([QEMU_BRIDGE_HELPER], [qemu-bridge-helper], + [/usr/libexec/qemu-bridge-helper], + [/usr/libexec:/usr/lib/qemu:/usr/lib]) + AC_DEFINE_UNQUOTED([QEMU_BRIDGE_HELPER], ["$QEMU_BRIDGE_HELPER"], + [QEMU bridge helper]) ]) AC_DEFUN([LIBVIRT_DRIVER_RESULT_QEMU], [ -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:24 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ---- m4/virt-driver-qemu.m4 | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-)
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 49 +++------------------------------- m4/virt-driver-lxc.m4 | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 46 deletions(-) create mode 100644 m4/virt-driver-lxc.m4 diff --git a/configure.ac b/configure.ac index 7713dab82f..89ce8a821d 100644 --- a/configure.ac +++ b/configure.ac @@ -407,7 +407,7 @@ LIBVIRT_ARG_WITH([PHYP], [PHYP], [check]) LIBVIRT_ARG_WITH([XENAPI], [XenAPI], [check]) LIBVIRT_ARG_WITH([LIBXL], [libxenlight], [check]) LIBVIRT_ARG_WITH([VBOX], [VirtualBox XPCOMC], [yes]) -LIBVIRT_ARG_WITH([LXC], [Linux Container], [check]) +LIBVIRT_DRIVER_ARG_LXC LIBVIRT_ARG_WITH([ESX], [ESX], [check]) LIBVIRT_ARG_WITH([HYPERV], [Hyper-V], [check]) LIBVIRT_ARG_WITH([TEST], [test driver], [yes]) @@ -712,50 +712,7 @@ dnl check for kvm headers dnl AC_CHECK_HEADERS([linux/kvm.h]) -dnl -dnl check for sufficient headers for LXC -dnl -if test "$with_libvirtd" = "no" ; then - with_lxc=no -fi -if test "$with_lxc" = "yes" || test "$with_lxc" = "check"; then - AC_LINK_IFELSE([AC_LANG_PROGRAM( - [[ - #include <sched.h> - #include <linux/loop.h> - #include <sys/epoll.h> - ]], [[ - unshare(!(LO_FLAGS_AUTOCLEAR + EPOLL_CLOEXEC)); - ]])], [ - with_lxc=yes - AC_DEFINE([HAVE_DECL_LO_FLAGS_AUTOCLEAR], [1], - [Define to 1 if you have the declaration of `LO_FLAGS_AUTOCLEAR', - and to 0 if you don't.]) - ], [ - if test "$with_lxc" = "check"; then - with_lxc=no - AC_MSG_NOTICE([Required kernel features were not found, disabling LXC]) - else - AC_MSG_ERROR([Required kernel features for LXC were not found]) - fi - ]) - AC_LINK_IFELSE([AC_LANG_PROGRAM( - [[ - #include <sched.h> - #include <linux/loop.h> - #include <sys/epoll.h> - ]], [[ - unshare(!(LOOP_CTL_GET_FREE)); - ]])], [ - AC_DEFINE([HAVE_DECL_LOOP_CTL_GET_FREE], [1], - [Define to 1 if you have the declaration of `LOOP_CTL_GET_FREE', - and to 0 if you don't.]) - ]) -fi -if test "$with_lxc" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_LXC], 1, [whether LXC driver is enabled]) -fi -AM_CONDITIONAL([WITH_LXC], [test "$with_lxc" = "yes"]) +LIBVIRT_DRIVER_CHECK_LXC AM_CONDITIONAL([WITH_SETUID_RPC_CLIENT], [test "$with_lxc$with_login_shell" != "nono"]) @@ -1640,7 +1597,7 @@ LIBVIRT_DRIVER_RESULT_VMWARE AC_MSG_NOTICE([ VBox: $with_vbox]) AC_MSG_NOTICE([ XenAPI: $with_xenapi]) AC_MSG_NOTICE([ xenlight: $with_libxl]) -AC_MSG_NOTICE([ LXC: $with_lxc]) +LIBVIRT_DRIVER_RESULT_LXC AC_MSG_NOTICE([ PHYP: $with_phyp]) AC_MSG_NOTICE([ ESX: $with_esx]) AC_MSG_NOTICE([ Hyper-V: $with_hyperv]) diff --git a/m4/virt-driver-lxc.m4 b/m4/virt-driver-lxc.m4 new file mode 100644 index 0000000000..c8448eef80 --- /dev/null +++ b/m4/virt-driver-lxc.m4 @@ -0,0 +1,74 @@ +dnl The LXC driver +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_DRIVER_ARG_LXC], [ + LIBVIRT_ARG_WITH([LXC], [Linux Container], [check]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_CHECK_LXC], [ + if test "$with_libvirtd" = "no" ; then + with_lxc=no + fi + + if test "$with_lxc" = "yes" || test "$with_lxc" = "check"; then + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include <sched.h> + #include <linux/loop.h> + #include <sys/epoll.h> + ]], [[ + unshare(!(LO_FLAGS_AUTOCLEAR + EPOLL_CLOEXEC)); + ]]) + ], [ + with_lxc=yes + AC_DEFINE([HAVE_DECL_LO_FLAGS_AUTOCLEAR], [1], + [Define to 1 if you have the declaration of `LO_FLAGS_AUTOCLEAR', + and to 0 if you don't.]) + ], [ + if test "$with_lxc" = "check"; then + with_lxc=no + AC_MSG_NOTICE([Required kernel features were not found, disabling LXC]) + else + AC_MSG_ERROR([Required kernel features for LXC were not found]) + fi + ]) + + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include <sched.h> + #include <linux/loop.h> + #include <sys/epoll.h> + ]], [[ + unshare(!(LOOP_CTL_GET_FREE)); + ]]) + ], [ + AC_DEFINE([HAVE_DECL_LOOP_CTL_GET_FREE], [1], + [Define to 1 if you have the declaration of `LOOP_CTL_GET_FREE', + and to 0 if you don't.]) + ]) + fi + if test "$with_lxc" = "yes" ; then + AC_DEFINE_UNQUOTED([WITH_LXC], 1, [whether LXC driver is enabled]) + fi + AM_CONDITIONAL([WITH_LXC], [test "$with_lxc" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_RESULT_LXC], [ + LIBVIRT_RESULT([LXC], [$with_lxc]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:25 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 49 +++------------------------------- m4/virt-driver-lxc.m4 | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 46 deletions(-) create mode 100644 m4/virt-driver-lxc.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 103 ++--------------------------------------- m4/virt-driver-xen.m4 | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+), 99 deletions(-) create mode 100644 m4/virt-driver-xen.m4 diff --git a/configure.ac b/configure.ac index 89ce8a821d..7d45d16ac5 100644 --- a/configure.ac +++ b/configure.ac @@ -398,8 +398,7 @@ if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then fi dnl Allow to build without Xen, QEMU/KVM, test or remote driver -LIBVIRT_ARG_WITH([XEN], [XEN], [check]) -LIBVIRT_ARG_WITH([XEN_INOTIFY], [XEN inotify], [check]) +LIBVIRT_DRIVER_ARG_XEN LIBVIRT_DRIVER_ARG_QEMU LIBVIRT_DRIVER_ARG_OPENVZ LIBVIRT_DRIVER_ARG_VMWARE @@ -613,101 +612,11 @@ AM_CONDITIONAL([WITH_LIBXL], [test "$with_libxl" = "yes"]) AC_SUBST([LIBXL_CFLAGS]) AC_SUBST([LIBXL_LIBS]) -old_LIBS="$LIBS" -old_CFLAGS="$CFLAGS" -XEN_LIBS="" -XEN_CFLAGS="" -dnl search for the Xen store library -if test "$with_xen" != "no" ; then - if test "$with_xen" != "yes" && test "$with_xen" != "check" ; then - XEN_CFLAGS="-I$with_xen/include" - XEN_LIBS="-L$with_xen/lib64 -L$with_xen/lib" - fi - fail=0 - CFLAGS="$CFLAGS $XEN_CFLAGS" - LIBS="$LIBS $XEN_LIBS" - AC_CHECK_LIB([xenstore], [xs_read], [ - with_xen=yes - XEN_LIBS="$XEN_LIBS -lxenstore" - ],[ - if test "$with_xen" = "yes"; then - fail=1 - fi - with_xen=no - ]) -fi - -if test "$with_xen" != "no" ; then - dnl In Xen 4.2, xs.h is deprecated in favor of xenstore.h. - AC_CHECK_HEADERS([xenstore.h]) - AC_CHECK_HEADERS([xen/xen.h xen/version.h xen/dom0_ops.h],,[ - if test "$with_xen" = "yes"; then - fail=1 - fi - with_xen=no - ], -[#include <stdio.h> -#include <stdint.h> -]) -fi - -if test "$with_xen" != "no" ; then - dnl Search for the location of <xen/{linux,sys}/privcmd.h>. - found= - AC_CHECK_HEADERS([xen/sys/privcmd.h xen/linux/privcmd.h], [found=yes; break;], [], - [#include <stdio.h> - #include <stdint.h> - #include <xen/xen.h> - ]) - if test "x$found" != "xyes"; then - if test "$with_xen" = "yes"; then - fail=1 - fi - with_xen=no - fi -fi - -LIBS="$old_LIBS" -CFLAGS="$old_CFLAGS" - -if test $fail = 1; then - AC_MSG_ERROR([You must install the Xen development package to compile Xen driver with -lxenstore]) -fi - -if test "$with_xen" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_XEN], 1, [whether Xen driver is enabled]) -fi - -AM_CONDITIONAL([WITH_XEN], [test "$with_xen" = "yes"]) -AC_SUBST([XEN_CFLAGS]) -AC_SUBST([XEN_LIBS]) +LIBVIRT_DRIVER_CHECK_XEN AM_CONDITIONAL([WITH_XENCONFIG], [test "$with_libxl" = "yes" || test "$with_xen" = "yes"]) dnl -dnl check for kernel headers required by xen_inotify -dnl -if test "$with_xen" != "yes"; then - with_xen_inotify=no -fi -if test "$with_xen_inotify" != "no"; then - AC_CHECK_HEADER([sys/inotify.h], [ - with_xen_inotify=yes - ], [ - if test "$with_xen_inotify" = "check"; then - with_xen_inotify=no - AC_MSG_NOTICE([Header file <sys/inotify.h> is required for Xen Inotify support, disabling it]) - else - AC_MSG_ERROR([Header file <sys/inotify.h> is required for Xen Inotify support!]) - fi - 0]) -fi -if test "$with_xen_inotify" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_XEN_INOTIFY], 1,[whether Xen inotify sub-driver is enabled]) -fi -AM_CONDITIONAL([WITH_XEN_INOTIFY], [test "$with_xen_inotify" = "yes"]) - -dnl dnl check for kvm headers dnl AC_CHECK_HEADERS([linux/kvm.h]) @@ -1589,7 +1498,7 @@ AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Drivers]) AC_MSG_NOTICE([]) -AC_MSG_NOTICE([ Xen: $with_xen]) +LIBVIRT_DRIVER_RESULT_XEN LIBVIRT_DRIVER_RESULT_QEMU LIBVIRT_DRIVER_RESULT_UML LIBVIRT_DRIVER_RESULT_OPENVZ @@ -1669,12 +1578,8 @@ LIBVIRT_RESULT_SSH2 LIBVIRT_RESULT_UDEV LIBVIRT_RESULT_VIRTUALPORT LIBVIRT_RESULT_XDR +LIBVIRT_RESULT_XEN LIBVIRT_RESULT_YAJL -if test "$with_xen" = "yes" ; then -AC_MSG_NOTICE([ xen: $XEN_CFLAGS $XEN_LIBS]) -else -AC_MSG_NOTICE([ xen: no]) -fi if test "$with_xenapi" = "yes" ; then AC_MSG_NOTICE([ xenapi: $LIBXENSERVER_CFLAGS $LIBXENSERVER_LIBS]) else diff --git a/m4/virt-driver-xen.m4 b/m4/virt-driver-xen.m4 new file mode 100644 index 0000000000..896e669c41 --- /dev/null +++ b/m4/virt-driver-xen.m4 @@ -0,0 +1,126 @@ +dnl The XEN driver +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_DRIVER_ARG_XEN], [ + LIBVIRT_ARG_WITH([XEN], [XEN], [check]) + LIBVIRT_ARG_WITH([XEN_INOTIFY], [XEN inotify], [check]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_CHECK_XEN], [ + old_LIBS="$LIBS" + old_CFLAGS="$CFLAGS" + XEN_LIBS="" + XEN_CFLAGS="" + + dnl search for the Xen store library + if test "$with_xen" != "no" ; then + if test "$with_xen" != "yes" && test "$with_xen" != "check" ; then + XEN_CFLAGS="-I$with_xen/include" + XEN_LIBS="-L$with_xen/lib64 -L$with_xen/lib" + fi + fail=0 + CFLAGS="$CFLAGS $XEN_CFLAGS" + LIBS="$LIBS $XEN_LIBS" + AC_CHECK_LIB([xenstore], [xs_read], [ + with_xen=yes + XEN_LIBS="$XEN_LIBS -lxenstore" + ],[ + if test "$with_xen" = "yes"; then + fail=1 + fi + with_xen=no + ]) + fi + + if test "$with_xen" != "no" ; then + dnl In Xen 4.2, xs.h is deprecated in favor of xenstore.h. + AC_CHECK_HEADERS([xenstore.h]) + AC_CHECK_HEADERS([xen/xen.h xen/version.h xen/dom0_ops.h],,[ + if test "$with_xen" = "yes"; then + fail=1 + fi + with_xen=no + ], +[#include <stdio.h> +#include <stdint.h> +]) + fi + + if test "$with_xen" != "no" ; then + dnl Search for the location of <xen/{linux,sys}/privcmd.h>. + found= + AC_CHECK_HEADERS([xen/sys/privcmd.h xen/linux/privcmd.h], [found=yes; break;], [], + [#include <stdio.h> + #include <stdint.h> + #include <xen/xen.h> + ]) + if test "x$found" != "xyes"; then + if test "$with_xen" = "yes"; then + fail=1 + fi + with_xen=no + fi + fi + + LIBS="$old_LIBS" + CFLAGS="$old_CFLAGS" + + if test $fail = 1; then + AC_MSG_ERROR([You must install the Xen development package to compile Xen driver with -lxenstore]) + fi + + if test "$with_xen" = "yes"; then + AC_DEFINE_UNQUOTED([WITH_XEN], 1, [whether Xen driver is enabled]) + fi + + AM_CONDITIONAL([WITH_XEN], [test "$with_xen" = "yes"]) + AC_SUBST([XEN_CFLAGS]) + AC_SUBST([XEN_LIBS]) + + dnl + dnl check for kernel headers required by xen_inotify + dnl + if test "$with_xen" != "yes"; then + with_xen_inotify=no + fi + if test "$with_xen_inotify" != "no"; then + AC_CHECK_HEADER([sys/inotify.h], [ + with_xen_inotify=yes + ], [ + if test "$with_xen_inotify" = "check"; then + with_xen_inotify=no + AC_MSG_NOTICE([Header file <sys/inotify.h> is required for Xen Inotify support, disabling it]) + else + AC_MSG_ERROR([Header file <sys/inotify.h> is required for Xen Inotify support!]) + fi + 0]) + fi + if test "$with_xen_inotify" = "yes"; then + AC_DEFINE_UNQUOTED([WITH_XEN_INOTIFY], 1, [whether Xen inotify sub-driver is enabled]) + fi + AM_CONDITIONAL([WITH_XEN_INOTIFY], [test "$with_xen_inotify" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_RESULT_XEN], [ + LIBVIRT_RESULT_LIB([XEN]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_RESULT_XEN], [ + LIBVIRT_RESULT([XEN], [$with_xen]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:26 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 103 ++--------------------------------------- m4/virt-driver-xen.m4 | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+), 99 deletions(-) create mode 100644 m4/virt-driver-xen.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 84 ++------------------------------------ m4/virt-driver-libxl.m4 | 105 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 80 deletions(-) create mode 100644 m4/virt-driver-libxl.m4 diff --git a/configure.ac b/configure.ac index 7d45d16ac5..09bf9c4307 100644 --- a/configure.ac +++ b/configure.ac @@ -404,7 +404,7 @@ LIBVIRT_DRIVER_ARG_OPENVZ LIBVIRT_DRIVER_ARG_VMWARE LIBVIRT_ARG_WITH([PHYP], [PHYP], [check]) LIBVIRT_ARG_WITH([XENAPI], [XenAPI], [check]) -LIBVIRT_ARG_WITH([LIBXL], [libxenlight], [check]) +LIBVIRT_DRIVER_ARG_LIBXL LIBVIRT_ARG_WITH([VBOX], [VirtualBox XPCOMC], [yes]) LIBVIRT_DRIVER_ARG_LXC LIBVIRT_ARG_WITH([ESX], [ESX], [check]) @@ -539,79 +539,7 @@ fi AC_SUBST([LIBXENSERVER_CFLAGS]) AC_SUBST([LIBXENSERVER_LIBS]) -old_LIBS="$LIBS" -old_CFLAGS="$CFLAGS" -LIBXL_LIBS="" -LIBXL_CFLAGS="" -LIBXL_FIRMWARE_DIR="" -LIBXL_EXECBIN_DIR="" - -dnl search for libxl, aka libxenlight -dnl Xen > 4.5 introduced a pkgconfig file, check for it first -fail=0 -if test "$with_libxl" != "no" ; then - PKG_CHECK_MODULES([LIBXL], [xenlight], [ - LIBXL_FIRMWARE_DIR=`$PKG_CONFIG --variable xenfirmwaredir xenlight` - LIBXL_EXECBIN_DIR=`$PKG_CONFIG --variable libexec_bin xenlight` - with_libxl=yes - ], [LIBXL_FOUND=no]) - if test "$LIBXL_FOUND" = "no"; then - dnl No xenlight pkg-config file - if test "$with_libxl" != "yes" && test "$with_libxl" != "check" ; then - LIBXL_CFLAGS="-I$with_libxl/include" - LIBXL_LIBS="-L$with_libxl" - fi - CFLAGS="$CFLAGS $LIBXL_CFLAGS" - LIBS="$LIBS $LIBXL_LIBS" - AC_CHECK_LIB([xenlight], [libxl_ctx_alloc], [ - with_libxl=yes - LIBXL_LIBS="$LIBXL_LIBS -lxenlight" - ],[ - if test "$with_libxl" = "yes"; then - fail=1 - fi - with_libxl=no - ]) - fi -fi - -# LIBXL_API_VERSION 4.4.0 introduced a new parameter to -# libxl_domain_create_restore for specifying restore parameters. -# The libxl driver will make use of this new parameter for specifying -# the Xen migration stream version. -LIBXL_CFLAGS="$LIBXL_CFLAGS -DLIBXL_API_VERSION=0x040400" -LIBS="$old_LIBS" -CFLAGS="$old_CFLAGS" - -if test $fail = 1; then - AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.2 to compile libxenlight driver with -lxl]) -fi - -if test "$with_libxl" = "yes"; then - dnl If building with libxl, use the libxl utility header and lib too - AC_CHECK_HEADERS([libxlutil.h]) - LIBXL_LIBS="$LIBXL_LIBS -lxlutil" - AC_DEFINE_UNQUOTED([WITH_LIBXL], 1, [whether libxenlight driver is enabled]) - if test "x$LIBXL_FIRMWARE_DIR" != "x"; then - AC_DEFINE_UNQUOTED([LIBXL_FIRMWARE_DIR], ["$LIBXL_FIRMWARE_DIR"], [directory containing Xen firmware blobs]) - fi - if test "x$LIBXL_EXECBIN_DIR" != "x"; then - AC_DEFINE_UNQUOTED([LIBXL_EXECBIN_DIR], ["$LIBXL_EXECBIN_DIR"], [directory containing Xen libexec binaries]) - fi - dnl Check if the xtl_* infrastructure is in libxentoollog - dnl (since Xen 4.7) if not then assume it is in libxenctrl - dnl (as it was for 4.6 and earler) - AC_CHECK_LIB([xentoollog], [xtl_createlogger_stdiostream], [ - LIBXL_LIBS="$LIBXL_LIBS -lxentoollog" - ],[ - LIBXL_LIBS="$LIBXL_LIBS -lxenctrl" - ]) -fi -AM_CONDITIONAL([WITH_LIBXL], [test "$with_libxl" = "yes"]) - -AC_SUBST([LIBXL_CFLAGS]) -AC_SUBST([LIBXL_LIBS]) - +LIBVIRT_DRIVER_CHECK_LIBXL LIBVIRT_DRIVER_CHECK_XEN AM_CONDITIONAL([WITH_XENCONFIG], [test "$with_libxl" = "yes" || test "$with_xen" = "yes"]) @@ -1505,7 +1433,7 @@ LIBVIRT_DRIVER_RESULT_OPENVZ LIBVIRT_DRIVER_RESULT_VMWARE AC_MSG_NOTICE([ VBox: $with_vbox]) AC_MSG_NOTICE([ XenAPI: $with_xenapi]) -AC_MSG_NOTICE([ xenlight: $with_libxl]) +LIBVIRT_DRIVER_RESULT_LIBXL LIBVIRT_DRIVER_RESULT_LXC AC_MSG_NOTICE([ PHYP: $with_phyp]) AC_MSG_NOTICE([ ESX: $with_esx]) @@ -1561,6 +1489,7 @@ LIBVIRT_RESULT_HAL LIBVIRT_RESULT_LIBNL LIBVIRT_RESULT_LIBPCAP LIBVIRT_RESULT_LIBSSH +LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_LIBXML LIBVIRT_RESULT_MACVTAP LIBVIRT_RESULT_NETCF @@ -1585,11 +1514,6 @@ AC_MSG_NOTICE([ xenapi: $LIBXENSERVER_CFLAGS $LIBXENSERVER_LIBS]) else AC_MSG_NOTICE([ xenapi: no]) fi -if test "$with_libxl" = "yes" ; then -AC_MSG_NOTICE([xenlight: $LIBXL_CFLAGS $LIBXL_LIBS]) -else -AC_MSG_NOTICE([xenlight: no]) -fi if test "$with_storage_rbd" = "yes" ; then AC_MSG_NOTICE([ rbd: $LIBRBD_LIBS]) else diff --git a/m4/virt-driver-libxl.m4 b/m4/virt-driver-libxl.m4 new file mode 100644 index 0000000000..8382dc0ec4 --- /dev/null +++ b/m4/virt-driver-libxl.m4 @@ -0,0 +1,105 @@ +dnl The libxl driver +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_DRIVER_ARG_LIBXL], [ + LIBVIRT_ARG_WITH([LIBXL], [libxenlight], [check]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ + old_LIBS="$LIBS" + old_CFLAGS="$CFLAGS" + LIBXL_LIBS="" + LIBXL_CFLAGS="" + LIBXL_FIRMWARE_DIR="" + LIBXL_EXECBIN_DIR="" + + dnl search for libxl, aka libxenlight + dnl Xen > 4.5 introduced a pkgconfig file, check for it first + fail=0 + if test "$with_libxl" != "no" ; then + PKG_CHECK_MODULES([LIBXL], [xenlight], [ + LIBXL_FIRMWARE_DIR=`$PKG_CONFIG --variable xenfirmwaredir xenlight` + LIBXL_EXECBIN_DIR=`$PKG_CONFIG --variable libexec_bin xenlight` + with_libxl=yes + ], [LIBXL_FOUND=no]) + if test "$LIBXL_FOUND" = "no"; then + dnl No xenlight pkg-config file + if test "$with_libxl" != "yes" && test "$with_libxl" != "check" ; then + LIBXL_CFLAGS="-I$with_libxl/include" + LIBXL_LIBS="-L$with_libxl" + fi + CFLAGS="$CFLAGS $LIBXL_CFLAGS" + LIBS="$LIBS $LIBXL_LIBS" + AC_CHECK_LIB([xenlight], [libxl_ctx_alloc], [ + with_libxl=yes + LIBXL_LIBS="$LIBXL_LIBS -lxenlight" + ],[ + if test "$with_libxl" = "yes"; then + fail=1 + fi + with_libxl=no + ]) + fi + fi + + dnl LIBXL_API_VERSION 4.4.0 introduced a new parameter to + dnl libxl_domain_create_restore for specifying restore parameters. + dnl The libxl driver will make use of this new parameter for specifying + dnl the Xen migration stream version. + LIBXL_CFLAGS="$LIBXL_CFLAGS -DLIBXL_API_VERSION=0x040400" + LIBS="$old_LIBS" + CFLAGS="$old_CFLAGS" + + if test $fail = 1; then + AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.2 to compile libxenlight driver with -lxl]) + fi + + if test "$with_libxl" = "yes"; then + dnl If building with libxl, use the libxl utility header and lib too + AC_CHECK_HEADERS([libxlutil.h]) + LIBXL_LIBS="$LIBXL_LIBS -lxlutil" + AC_DEFINE_UNQUOTED([WITH_LIBXL], 1, [whether libxenlight driver is enabled]) + if test "x$LIBXL_FIRMWARE_DIR" != "x"; then + AC_DEFINE_UNQUOTED([LIBXL_FIRMWARE_DIR], ["$LIBXL_FIRMWARE_DIR"], [directory containing Xen firmware blobs]) + fi + if test "x$LIBXL_EXECBIN_DIR" != "x"; then + AC_DEFINE_UNQUOTED([LIBXL_EXECBIN_DIR], ["$LIBXL_EXECBIN_DIR"], [directory containing Xen libexec binaries]) + fi + dnl Check if the xtl_* infrastructure is in libxentoollog + dnl (since Xen 4.7) if not then assume it is in libxenctrl + dnl (as it was for 4.6 and earler) + AC_CHECK_LIB([xentoollog], [xtl_createlogger_stdiostream], [ + LIBXL_LIBS="$LIBXL_LIBS -lxentoollog" + ],[ + LIBXL_LIBS="$LIBXL_LIBS -lxenctrl" + ]) + fi + AM_CONDITIONAL([WITH_LIBXL], [test "$with_libxl" = "yes"]) + + AC_SUBST([LIBXL_CFLAGS]) + AC_SUBST([LIBXL_LIBS]) +]) + +AC_DEFUN([LIBVIRT_RESULT_LIBXL], [ + LIBVIRT_RESULT_LIB([LIBXL]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_RESULT_LIBXL], [ + LIBVIRT_RESULT([libxl], [$with_libxl]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:27 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 84 ++------------------------------------ m4/virt-driver-libxl.m4 | 105 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 80 deletions(-) create mode 100644 m4/virt-driver-libxl.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-driver-libxl.m4 | 43 +++++++++++++------------------------------ 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/m4/virt-driver-libxl.m4 b/m4/virt-driver-libxl.m4 index 8382dc0ec4..2fdeaa506e 100644 --- a/m4/virt-driver-libxl.m4 +++ b/m4/virt-driver-libxl.m4 @@ -31,30 +31,19 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ dnl search for libxl, aka libxenlight dnl Xen > 4.5 introduced a pkgconfig file, check for it first - fail=0 - if test "$with_libxl" != "no" ; then - PKG_CHECK_MODULES([LIBXL], [xenlight], [ - LIBXL_FIRMWARE_DIR=`$PKG_CONFIG --variable xenfirmwaredir xenlight` - LIBXL_EXECBIN_DIR=`$PKG_CONFIG --variable libexec_bin xenlight` - with_libxl=yes - ], [LIBXL_FOUND=no]) - if test "$LIBXL_FOUND" = "no"; then - dnl No xenlight pkg-config file - if test "$with_libxl" != "yes" && test "$with_libxl" != "check" ; then - LIBXL_CFLAGS="-I$with_libxl/include" - LIBXL_LIBS="-L$with_libxl" - fi - CFLAGS="$CFLAGS $LIBXL_CFLAGS" - LIBS="$LIBS $LIBXL_LIBS" - AC_CHECK_LIB([xenlight], [libxl_ctx_alloc], [ - with_libxl=yes - LIBXL_LIBS="$LIBXL_LIBS -lxenlight" - ],[ - if test "$with_libxl" = "yes"; then - fail=1 - fi - with_libxl=no - ]) + old_with_libxl="$with_libxl" + LIBVIRT_CHECK_PKG([LIBXL], [xenlight], [4.4.0], [true]) + if test "x$with_libxl" = "xyes" ; then + LIBXL_FIRMWARE_DIR=$($PKG_CONFIG --variable xenfirmwaredir xenlight) + LIBXL_EXECBIN_DIR=$($PKG_CONFIG --variable libexec_bin xenlight) + fi + + dnl pkgconfig file not found, fallback to lib probe + if test "x$with_libxl" = "xno" ; then + with_libxl="$old_with_libxl" + LIBVIRT_CHECK_LIB([LIBXL], [xenlight], [libxl_ctx_alloc], [libxl.h], [fail="1"]) + if test $fail = 1; then + AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.2 to compile libxenlight driver with -lxl]) fi fi @@ -66,15 +55,10 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ LIBS="$old_LIBS" CFLAGS="$old_CFLAGS" - if test $fail = 1; then - AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.2 to compile libxenlight driver with -lxl]) - fi - if test "$with_libxl" = "yes"; then dnl If building with libxl, use the libxl utility header and lib too AC_CHECK_HEADERS([libxlutil.h]) LIBXL_LIBS="$LIBXL_LIBS -lxlutil" - AC_DEFINE_UNQUOTED([WITH_LIBXL], 1, [whether libxenlight driver is enabled]) if test "x$LIBXL_FIRMWARE_DIR" != "x"; then AC_DEFINE_UNQUOTED([LIBXL_FIRMWARE_DIR], ["$LIBXL_FIRMWARE_DIR"], [directory containing Xen firmware blobs]) fi @@ -90,7 +74,6 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ LIBXL_LIBS="$LIBXL_LIBS -lxenctrl" ]) fi - AM_CONDITIONAL([WITH_LIBXL], [test "$with_libxl" = "yes"]) AC_SUBST([LIBXL_CFLAGS]) AC_SUBST([LIBXL_LIBS]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:28 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-driver-libxl.m4 | 43 +++++++++++++------------------------------ 1 file changed, 13 insertions(+), 30 deletions(-)
diff --git a/m4/virt-driver-libxl.m4 b/m4/virt-driver-libxl.m4 index 8382dc0ec4..2fdeaa506e 100644 --- a/m4/virt-driver-libxl.m4 +++ b/m4/virt-driver-libxl.m4 @@ -31,30 +31,19 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [
dnl search for libxl, aka libxenlight dnl Xen > 4.5 introduced a pkgconfig file, check for it first - fail=0 - if test "$with_libxl" != "no" ; then - PKG_CHECK_MODULES([LIBXL], [xenlight], [ - LIBXL_FIRMWARE_DIR=`$PKG_CONFIG --variable xenfirmwaredir xenlight` - LIBXL_EXECBIN_DIR=`$PKG_CONFIG --variable libexec_bin xenlight` - with_libxl=yes - ], [LIBXL_FOUND=no]) ... + old_with_libxl="$with_libxl" + LIBVIRT_CHECK_PKG([LIBXL], [xenlight], [4.4.0], [true])
Why 4.4.0? The comment above says pkgconfig file was introduced in 4.5 and libvirt requires libxenlight 4.2. So either this check should require libxenlight 4.2.0 (if we are brave and want to check a possible downstream pkgconfig file) or 4.5.0. Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-driver-libxl.m4 | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/m4/virt-driver-libxl.m4 b/m4/virt-driver-libxl.m4 index 2fdeaa506e..498cad3240 100644 --- a/m4/virt-driver-libxl.m4 +++ b/m4/virt-driver-libxl.m4 @@ -28,6 +28,7 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ LIBXL_CFLAGS="" LIBXL_FIRMWARE_DIR="" LIBXL_EXECBIN_DIR="" + LIBXL_API_VERSION="-DLIBXL_API_VERSION=0x040400" dnl search for libxl, aka libxenlight dnl Xen > 4.5 introduced a pkgconfig file, check for it first @@ -41,17 +42,22 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ dnl pkgconfig file not found, fallback to lib probe if test "x$with_libxl" = "xno" ; then with_libxl="$old_with_libxl" + + dnl LIBXL_API_VERSION 4.4.0 introduced a new parameter to + dnl libxl_domain_create_restore for specifying restore parameters. + dnl The libxl driver will make use of this new parameter for specifying + dnl the Xen migration stream version. Specify LIBXL_API_VERSION to trigger + dnl an error if there is too old xenlight + CFLAGS="$CFLAGS $LIBXL_API_VERSION" LIBVIRT_CHECK_LIB([LIBXL], [xenlight], [libxl_ctx_alloc], [libxl.h], [fail="1"]) + CFLAGS="$old_CFLAGS" + if test $fail = 1; then - AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.2 to compile libxenlight driver with -lxl]) + AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.4 to compile libxenlight driver with -lxl]) fi fi - dnl LIBXL_API_VERSION 4.4.0 introduced a new parameter to - dnl libxl_domain_create_restore for specifying restore parameters. - dnl The libxl driver will make use of this new parameter for specifying - dnl the Xen migration stream version. - LIBXL_CFLAGS="$LIBXL_CFLAGS -DLIBXL_API_VERSION=0x040400" + LIBXL_CFLAGS="$LIBXL_CFLAGS $LIBXL_API_VERSION" LIBS="$old_LIBS" CFLAGS="$old_CFLAGS" -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:29 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-driver-libxl.m4 | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/m4/virt-driver-libxl.m4 b/m4/virt-driver-libxl.m4 index 2fdeaa506e..498cad3240 100644 --- a/m4/virt-driver-libxl.m4 +++ b/m4/virt-driver-libxl.m4 @@ -28,6 +28,7 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ LIBXL_CFLAGS="" LIBXL_FIRMWARE_DIR="" LIBXL_EXECBIN_DIR="" + LIBXL_API_VERSION="-DLIBXL_API_VERSION=0x040400"
dnl search for libxl, aka libxenlight dnl Xen > 4.5 introduced a pkgconfig file, check for it first @@ -41,17 +42,22 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ dnl pkgconfig file not found, fallback to lib probe if test "x$with_libxl" = "xno" ; then with_libxl="$old_with_libxl" + + dnl LIBXL_API_VERSION 4.4.0 introduced a new parameter to + dnl libxl_domain_create_restore for specifying restore parameters. + dnl The libxl driver will make use of this new parameter for specifying + dnl the Xen migration stream version. Specify LIBXL_API_VERSION to trigger + dnl an error if there is too old xenlight + CFLAGS="$CFLAGS $LIBXL_API_VERSION" LIBVIRT_CHECK_LIB([LIBXL], [xenlight], [libxl_ctx_alloc], [libxl.h], [fail="1"]) + CFLAGS="$old_CFLAGS" + if test $fail = 1; then - AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.2 to compile libxenlight driver with -lxl]) + AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.4 to compile libxenlight driver with -lxl])
I see. We actually do not support libxenlight 4.2. I guess the 4.4.0 requirement in the previous patch should be changed to 4.2.0 and fixed to 4.4.0 in this patch. Jirka

On Wed, Dec 21, 2016 at 10:52:17AM +0100, Jiri Denemark wrote:
On Fri, Dec 16, 2016 at 10:11:29 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-driver-libxl.m4 | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/m4/virt-driver-libxl.m4 b/m4/virt-driver-libxl.m4 index 2fdeaa506e..498cad3240 100644 --- a/m4/virt-driver-libxl.m4 +++ b/m4/virt-driver-libxl.m4 @@ -28,6 +28,7 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ LIBXL_CFLAGS="" LIBXL_FIRMWARE_DIR="" LIBXL_EXECBIN_DIR="" + LIBXL_API_VERSION="-DLIBXL_API_VERSION=0x040400"
dnl search for libxl, aka libxenlight dnl Xen > 4.5 introduced a pkgconfig file, check for it first @@ -41,17 +42,22 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ dnl pkgconfig file not found, fallback to lib probe if test "x$with_libxl" = "xno" ; then with_libxl="$old_with_libxl" + + dnl LIBXL_API_VERSION 4.4.0 introduced a new parameter to + dnl libxl_domain_create_restore for specifying restore parameters. + dnl The libxl driver will make use of this new parameter for specifying + dnl the Xen migration stream version. Specify LIBXL_API_VERSION to trigger + dnl an error if there is too old xenlight + CFLAGS="$CFLAGS $LIBXL_API_VERSION" LIBVIRT_CHECK_LIB([LIBXL], [xenlight], [libxl_ctx_alloc], [libxl.h], [fail="1"]) + CFLAGS="$old_CFLAGS" + if test $fail = 1; then - AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.2 to compile libxenlight driver with -lxl]) + AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.4 to compile libxenlight driver with -lxl])
I see. We actually do not support libxenlight 4.2. I guess the 4.4.0 requirement in the previous patch should be changed to 4.2.0 and fixed to 4.4.0 in this patch.
I'll do it like that. Again this is due to splitting the fix into multiple patches. Thanks, Pavel

On Wed, Dec 21, 2016 at 14:14:25 +0100, Pavel Hrdina wrote:
On Wed, Dec 21, 2016 at 10:52:17AM +0100, Jiri Denemark wrote:
On Fri, Dec 16, 2016 at 10:11:29 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-driver-libxl.m4 | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/m4/virt-driver-libxl.m4 b/m4/virt-driver-libxl.m4 index 2fdeaa506e..498cad3240 100644 --- a/m4/virt-driver-libxl.m4 +++ b/m4/virt-driver-libxl.m4 @@ -28,6 +28,7 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ LIBXL_CFLAGS="" LIBXL_FIRMWARE_DIR="" LIBXL_EXECBIN_DIR="" + LIBXL_API_VERSION="-DLIBXL_API_VERSION=0x040400"
dnl search for libxl, aka libxenlight dnl Xen > 4.5 introduced a pkgconfig file, check for it first @@ -41,17 +42,22 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ dnl pkgconfig file not found, fallback to lib probe if test "x$with_libxl" = "xno" ; then with_libxl="$old_with_libxl" + + dnl LIBXL_API_VERSION 4.4.0 introduced a new parameter to + dnl libxl_domain_create_restore for specifying restore parameters. + dnl The libxl driver will make use of this new parameter for specifying + dnl the Xen migration stream version. Specify LIBXL_API_VERSION to trigger + dnl an error if there is too old xenlight + CFLAGS="$CFLAGS $LIBXL_API_VERSION" LIBVIRT_CHECK_LIB([LIBXL], [xenlight], [libxl_ctx_alloc], [libxl.h], [fail="1"]) + CFLAGS="$old_CFLAGS" + if test $fail = 1; then - AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.2 to compile libxenlight driver with -lxl]) + AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.4 to compile libxenlight driver with -lxl])
I see. We actually do not support libxenlight 4.2. I guess the 4.4.0 requirement in the previous patch should be changed to 4.2.0 and fixed to 4.4.0 in this patch.
I'll do it like that. Again this is due to splitting the fix into multiple patches.
ACK to both with this fix then. Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-driver-libxl.m4 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/m4/virt-driver-libxl.m4 b/m4/virt-driver-libxl.m4 index 498cad3240..0430ea3881 100644 --- a/m4/virt-driver-libxl.m4 +++ b/m4/virt-driver-libxl.m4 @@ -22,8 +22,6 @@ AC_DEFUN([LIBVIRT_DRIVER_ARG_LIBXL], [ ]) AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ - old_LIBS="$LIBS" - old_CFLAGS="$CFLAGS" LIBXL_LIBS="" LIBXL_CFLAGS="" LIBXL_FIRMWARE_DIR="" @@ -48,6 +46,7 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ dnl The libxl driver will make use of this new parameter for specifying dnl the Xen migration stream version. Specify LIBXL_API_VERSION to trigger dnl an error if there is too old xenlight + old_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $LIBXL_API_VERSION" LIBVIRT_CHECK_LIB([LIBXL], [xenlight], [libxl_ctx_alloc], [libxl.h], [fail="1"]) CFLAGS="$old_CFLAGS" @@ -57,11 +56,12 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ fi fi - LIBXL_CFLAGS="$LIBXL_CFLAGS $LIBXL_API_VERSION" - LIBS="$old_LIBS" - CFLAGS="$old_CFLAGS" - if test "$with_libxl" = "yes"; then + old_LIBS="$LIBS" + old_CFLAGS="$CFLAGS" + + LIBXL_CFLAGS="$LIBXL_CFLAGS $LIBXL_API_VERSION" + dnl If building with libxl, use the libxl utility header and lib too AC_CHECK_HEADERS([libxlutil.h]) LIBXL_LIBS="$LIBXL_LIBS -lxlutil" @@ -79,6 +79,9 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ ],[ LIBXL_LIBS="$LIBXL_LIBS -lxenctrl" ]) + + CFLAGS="$old_CFLAGS" + LIBS="$old_LIBS" fi AC_SUBST([LIBXL_CFLAGS]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:30 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-driver-libxl.m4 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 63 +++---------------------------------- m4/virt-driver-xenapi.m4 | 82 ++++++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 4 +-- 3 files changed, 88 insertions(+), 61 deletions(-) create mode 100644 m4/virt-driver-xenapi.m4 diff --git a/configure.ac b/configure.ac index 09bf9c4307..4b041adeac 100644 --- a/configure.ac +++ b/configure.ac @@ -403,7 +403,7 @@ LIBVIRT_DRIVER_ARG_QEMU LIBVIRT_DRIVER_ARG_OPENVZ LIBVIRT_DRIVER_ARG_VMWARE LIBVIRT_ARG_WITH([PHYP], [PHYP], [check]) -LIBVIRT_ARG_WITH([XENAPI], [XenAPI], [check]) +LIBVIRT_DRIVER_ARG_XENAPI LIBVIRT_DRIVER_ARG_LIBXL LIBVIRT_ARG_WITH([VBOX], [VirtualBox XPCOMC], [yes]) LIBVIRT_DRIVER_ARG_LXC @@ -492,53 +492,7 @@ if test "$with_libvirtd" = "yes" ; then fi AM_CONDITIONAL([WITH_LIBVIRTD], [test "$with_libvirtd" = "yes"]) -old_LIBS="$LIBS" -old_CFLAGS="$CFLAGS" -LIBXENSERVER_LIBS="" -LIBXENSERVER_CFLAGS="" -dnl search for the XenServer library -fail=0 -if test "$with_xenapi" != "no" ; then - if test "$with_xenapi" != "yes" && test "$with_xenapi" != "check" ; then - LIBXENSERVER_CFLAGS="-I$with_xenapi/include" - LIBXENSERVER_LIBS="-L$with_xenapi" - fi - CFLAGS="$CFLAGS $LIBXENSERVER_CFLAGS" - LIBS="$LIBS $LIBXENSERVER_LIBS" - AC_CHECK_LIB([xenserver], [xen_vm_start], [ - LIBXENSERVER_LIBS="$LIBXENSERVER_LIBS -lxenserver" - ],[ - if test "$with_xenapi" = "yes"; then - fail=1 - fi - with_xenapi=no - ]) - if test "$with_xenapi" != "no" ; then - if test "$with_curl" = "no"; then - if test "$with_xenapi" = "yes"; then - fail=1 - fi - with_xenapi=no - else - with_xenapi=yes - fi - fi -fi - -LIBS="$old_LIBS" -CFLAGS="$old_CFLAGS" - -if test $fail = 1; then - AC_MSG_ERROR([You must install libxenserver and libcurl to compile the XenAPI driver]) -fi - -if test "$with_xenapi" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_XENAPI], 1, [whether XenAPI driver is enabled]) -fi - -AC_SUBST([LIBXENSERVER_CFLAGS]) -AC_SUBST([LIBXENSERVER_LIBS]) - +LIBVIRT_DRIVER_CHECK_XENAPI LIBVIRT_DRIVER_CHECK_LIBXL LIBVIRT_DRIVER_CHECK_XEN @@ -1087,11 +1041,6 @@ if test "$with_vmx" = "yes" ; then fi AM_CONDITIONAL([WITH_VMX], [test "$with_vmx" = "yes"]) -if test "$with_xenapi" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_XENAPI], 1, [whether XenAPI driver is enabled]) -fi -AM_CONDITIONAL([WITH_XENAPI], [test "$with_xenapi" = "yes"]) - dnl dnl check for Hyper-V @@ -1432,7 +1381,7 @@ LIBVIRT_DRIVER_RESULT_UML LIBVIRT_DRIVER_RESULT_OPENVZ LIBVIRT_DRIVER_RESULT_VMWARE AC_MSG_NOTICE([ VBox: $with_vbox]) -AC_MSG_NOTICE([ XenAPI: $with_xenapi]) +LIBVIRT_DRIVER_RESULT_XENAPI LIBVIRT_DRIVER_RESULT_LIBXL LIBVIRT_DRIVER_RESULT_LXC AC_MSG_NOTICE([ PHYP: $with_phyp]) @@ -1508,12 +1457,8 @@ LIBVIRT_RESULT_UDEV LIBVIRT_RESULT_VIRTUALPORT LIBVIRT_RESULT_XDR LIBVIRT_RESULT_XEN +LIBVIRT_RESULT_XENAPI LIBVIRT_RESULT_YAJL -if test "$with_xenapi" = "yes" ; then -AC_MSG_NOTICE([ xenapi: $LIBXENSERVER_CFLAGS $LIBXENSERVER_LIBS]) -else -AC_MSG_NOTICE([ xenapi: no]) -fi if test "$with_storage_rbd" = "yes" ; then AC_MSG_NOTICE([ rbd: $LIBRBD_LIBS]) else diff --git a/m4/virt-driver-xenapi.m4 b/m4/virt-driver-xenapi.m4 new file mode 100644 index 0000000000..3f37d8da9f --- /dev/null +++ b/m4/virt-driver-xenapi.m4 @@ -0,0 +1,82 @@ +dnl The XenAPI driver +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_DRIVER_ARG_XENAPI], [ + LIBVIRT_ARG_WITH([XENAPI], [XenAPI], [check]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_CHECK_XENAPI], [ + AC_REQUIRE([LIBVIRT_CHECK_CURL]) + + old_LIBS="$LIBS" + old_CFLAGS="$CFLAGS" + XENAPI_LIBS="" + XENAPI_CFLAGS="" + dnl search for the XenServer library + fail=0 + if test "$with_xenapi" != "no" ; then + if test "$with_xenapi" != "yes" && test "$with_xenapi" != "check" ; then + XENAPI_CFLAGS="-I$with_xenapi/include" + XENAPI_LIBS="-L$with_xenapi" + fi + CFLAGS="$CFLAGS $XENAPI_CFLAGS" + LIBS="$LIBS $XENAPI_LIBS" + AC_CHECK_LIB([xenserver], [xen_vm_start], [ + XENAPI_LIBS="$XENAPI_LIBS -lxenserver" + ],[ + if test "$with_xenapi" = "yes"; then + fail=1 + fi + with_xenapi=no + ]) + if test "$with_xenapi" != "no" ; then + if test "$with_curl" = "no"; then + if test "$with_xenapi" = "yes"; then + fail=1 + fi + with_xenapi=no + else + with_xenapi=yes + fi + fi + fi + + LIBS="$old_LIBS" + CFLAGS="$old_CFLAGS" + + if test $fail = 1; then + AC_MSG_ERROR([You must install libxenserver and libcurl to compile the XenAPI driver]) + fi + + if test "$with_xenapi" = "yes"; then + AC_DEFINE_UNQUOTED([WITH_XENAPI], 1, [whether XenAPI driver is enabled]) + fi + AM_CONDITIONAL([WITH_XENAPI], [test "$with_xenapi" = "yes"]) + + AC_SUBST([XENAPI_CFLAGS]) + AC_SUBST([XENAPI_LIBS]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_RESULT_XENAPI], [ + LIBVIRT_RESULT([XenAPI], [$with_xenapi]) +]) + +AC_DEFUN([LIBVIRT_RESULT_XENAPI], [ + LIBVIRT_RESULT_LIB([XENAPI]) +]) diff --git a/src/Makefile.am b/src/Makefile.am index 262528cb14..767fee66f0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1316,10 +1316,10 @@ endif WITH_VBOX if WITH_XENAPI noinst_LTLIBRARIES += libvirt_driver_xenapi.la libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la -libvirt_driver_xenapi_la_CFLAGS = $(LIBXENSERVER_CFLAGS) $(CURL_CFLAGS) \ +libvirt_driver_xenapi_la_CFLAGS = $(XENAPI_CFLAGS) $(CURL_CFLAGS) \ -I$(srcdir)/conf -I$(srcdir)/xenconfig $(AM_CFLAGS) libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS) -libvirt_driver_xenapi_la_LIBADD = $(LIBXENSERVER_LIBS) $(CURL_LIBS) +libvirt_driver_xenapi_la_LIBADD = $(XENAPI_LIBS) $(CURL_LIBS) libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES) endif WITH_XENAPI -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:31 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 63 +++---------------------------------- m4/virt-driver-xenapi.m4 | 82 ++++++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 4 +-- 3 files changed, 88 insertions(+), 61 deletions(-) create mode 100644 m4/virt-driver-xenapi.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-driver-xenapi.m4 | 50 ++++++++---------------------------------------- 1 file changed, 8 insertions(+), 42 deletions(-) diff --git a/m4/virt-driver-xenapi.m4 b/m4/virt-driver-xenapi.m4 index 3f37d8da9f..28c092dcb8 100644 --- a/m4/virt-driver-xenapi.m4 +++ b/m4/virt-driver-xenapi.m4 @@ -24,53 +24,19 @@ AC_DEFUN([LIBVIRT_DRIVER_ARG_XENAPI], [ AC_DEFUN([LIBVIRT_DRIVER_CHECK_XENAPI], [ AC_REQUIRE([LIBVIRT_CHECK_CURL]) - old_LIBS="$LIBS" - old_CFLAGS="$CFLAGS" - XENAPI_LIBS="" - XENAPI_CFLAGS="" + old_with_xenapi="$with_xenapi" + dnl search for the XenServer library - fail=0 - if test "$with_xenapi" != "no" ; then - if test "$with_xenapi" != "yes" && test "$with_xenapi" != "check" ; then - XENAPI_CFLAGS="-I$with_xenapi/include" - XENAPI_LIBS="-L$with_xenapi" - fi - CFLAGS="$CFLAGS $XENAPI_CFLAGS" - LIBS="$LIBS $XENAPI_LIBS" - AC_CHECK_LIB([xenserver], [xen_vm_start], [ - XENAPI_LIBS="$XENAPI_LIBS -lxenserver" - ],[ - if test "$with_xenapi" = "yes"; then - fail=1 + LIBVIRT_CHECK_LIB([XENAPI], [xenserver], [xen_vm_start], [xen/api/xen_vm.h]) + + if test "x$with_xenapi" = "xyes" ; then + if test "x$with_curl" = "xno"; then + if test "$old_with_xenapi" != "check"; then + AC_MSG_ERROR([You must install libcurl to compile the XenAPI driver]) fi with_xenapi=no - ]) - if test "$with_xenapi" != "no" ; then - if test "$with_curl" = "no"; then - if test "$with_xenapi" = "yes"; then - fail=1 - fi - with_xenapi=no - else - with_xenapi=yes - fi fi fi - - LIBS="$old_LIBS" - CFLAGS="$old_CFLAGS" - - if test $fail = 1; then - AC_MSG_ERROR([You must install libxenserver and libcurl to compile the XenAPI driver]) - fi - - if test "$with_xenapi" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_XENAPI], 1, [whether XenAPI driver is enabled]) - fi - AM_CONDITIONAL([WITH_XENAPI], [test "$with_xenapi" = "yes"]) - - AC_SUBST([XENAPI_CFLAGS]) - AC_SUBST([XENAPI_LIBS]) ]) AC_DEFUN([LIBVIRT_DRIVER_RESULT_XENAPI], [ -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:32 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-driver-xenapi.m4 | 50 ++++++++---------------------------------------- 1 file changed, 8 insertions(+), 42 deletions(-)
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 22 +++------------------- m4/virt-driver-phyp.m4 | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 m4/virt-driver-phyp.m4 diff --git a/configure.ac b/configure.ac index 4b041adeac..fac9864217 100644 --- a/configure.ac +++ b/configure.ac @@ -402,7 +402,7 @@ LIBVIRT_DRIVER_ARG_XEN LIBVIRT_DRIVER_ARG_QEMU LIBVIRT_DRIVER_ARG_OPENVZ LIBVIRT_DRIVER_ARG_VMWARE -LIBVIRT_ARG_WITH([PHYP], [PHYP], [check]) +LIBVIRT_DRIVER_ARG_PHYP LIBVIRT_DRIVER_ARG_XENAPI LIBVIRT_DRIVER_ARG_LIBXL LIBVIRT_ARG_WITH([VBOX], [VirtualBox XPCOMC], [yes]) @@ -634,23 +634,7 @@ dnl dnl check for PHYP dnl -if test "$with_phyp" != "no"; then - if test "$with_ssh2" = "no" ; then - if test "$with_phyp" = "check"; then - with_phyp=no - else - AC_MSG_ERROR([libssh2 is required for Phyp driver]) - fi - else - with_phyp=yes - fi -fi - -if test "$with_phyp" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_PHYP], 1, [whether IBM HMC / IVM driver is enabled]) -fi - -AM_CONDITIONAL([WITH_PHYP],[test "$with_phyp" = "yes"]) +LIBVIRT_DRIVER_CHECK_PHYP dnl check if the network driver should be compiled @@ -1384,7 +1368,7 @@ AC_MSG_NOTICE([ VBox: $with_vbox]) LIBVIRT_DRIVER_RESULT_XENAPI LIBVIRT_DRIVER_RESULT_LIBXL LIBVIRT_DRIVER_RESULT_LXC -AC_MSG_NOTICE([ PHYP: $with_phyp]) +LIBVIRT_DRIVER_RESULT_PHYP AC_MSG_NOTICE([ ESX: $with_esx]) AC_MSG_NOTICE([ Hyper-V: $with_hyperv]) LIBVIRT_DRIVER_RESULT_VZ diff --git a/m4/virt-driver-phyp.m4 b/m4/virt-driver-phyp.m4 new file mode 100644 index 0000000000..fb4189e779 --- /dev/null +++ b/m4/virt-driver-phyp.m4 @@ -0,0 +1,48 @@ +dnl The Phyp driver +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_DRIVER_ARG_PHYP], [ + LIBVIRT_ARG_WITH([PHYP], [PHYP], [check]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_CHECK_PHYP], [ + AC_REQUIRE([LIBVIRT_CHECK_SSH2]) + + if test "$with_phyp" != "no"; then + if test "$with_ssh2" = "no" ; then + if test "$with_phyp" = "check"; then + with_phyp=no + else + AC_MSG_ERROR([libssh2 is required for Phyp driver]) + fi + else + with_phyp=yes + fi + fi + + if test "$with_phyp" = "yes"; then + AC_DEFINE_UNQUOTED([WITH_PHYP], 1, [whether IBM HMC / IVM driver is enabled]) + fi + + AM_CONDITIONAL([WITH_PHYP],[test "$with_phyp" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_RESULT_PHYP], [ + LIBVIRT_RESULT([PHYP], [$with_phyp]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:33 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 22 +++------------------- m4/virt-driver-phyp.m4 | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 m4/virt-driver-phyp.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 10 +++------- m4/virt-driver-test.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 m4/virt-driver-test.m4 diff --git a/configure.ac b/configure.ac index fac9864217..d1e37a81a7 100644 --- a/configure.ac +++ b/configure.ac @@ -409,7 +409,7 @@ LIBVIRT_ARG_WITH([VBOX], [VirtualBox XPCOMC], [yes]) LIBVIRT_DRIVER_ARG_LXC LIBVIRT_ARG_WITH([ESX], [ESX], [check]) LIBVIRT_ARG_WITH([HYPERV], [Hyper-V], [check]) -LIBVIRT_ARG_WITH([TEST], [test driver], [yes]) +LIBVIRT_DRIVER_ARG_TEST LIBVIRT_ARG_WITH([REMOTE], [remote driver], [yes]) LIBVIRT_ARG_WITH([LIBVIRTD], [libvirtd], [yes]) @@ -476,11 +476,7 @@ fi AM_CONDITIONAL([WITH_VBOX], [test "$with_vbox" = "yes"]) LIBVIRT_DRIVER_CHECK_QEMU - -if test "$with_test" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_TEST], 1, [whether Test driver is enabled]) -fi -AM_CONDITIONAL([WITH_TEST], [test "$with_test" = "yes"]) +LIBVIRT_DRIVER_CHECK_TEST if test "$with_remote" = "yes" ; then AC_DEFINE_UNQUOTED([WITH_REMOTE], 1, [whether Remote driver is enabled]) @@ -1373,7 +1369,7 @@ AC_MSG_NOTICE([ ESX: $with_esx]) AC_MSG_NOTICE([ Hyper-V: $with_hyperv]) LIBVIRT_DRIVER_RESULT_VZ LIBVIRT_DRIVER_RESULT_BHYVE -AC_MSG_NOTICE([ Test: $with_test]) +LIBVIRT_DRIVER_RESULT_TEST AC_MSG_NOTICE([ Remote: $with_remote]) AC_MSG_NOTICE([ Network: $with_network]) AC_MSG_NOTICE([ Libvirtd: $with_libvirtd]) diff --git a/m4/virt-driver-test.m4 b/m4/virt-driver-test.m4 new file mode 100644 index 0000000000..fd218f0280 --- /dev/null +++ b/m4/virt-driver-test.m4 @@ -0,0 +1,33 @@ +dnl The test driver +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_DRIVER_ARG_TEST], [ + LIBVIRT_ARG_WITH([TEST], [test driver], [yes]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_CHECK_TEST], [ + if test "$with_test" = "yes" ; then + AC_DEFINE_UNQUOTED([WITH_TEST], 1, [whether Test driver is enabled]) + fi + AM_CONDITIONAL([WITH_TEST], [test "$with_test" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_RESULT_TEST], [ + LIBVIRT_RESULT([Test], [$with_test]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:34 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 10 +++------- m4/virt-driver-test.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 m4/virt-driver-test.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 10 +++------- m4/virt-driver-remote.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 m4/virt-driver-remote.m4 diff --git a/configure.ac b/configure.ac index d1e37a81a7..5f1c2013d2 100644 --- a/configure.ac +++ b/configure.ac @@ -410,7 +410,7 @@ LIBVIRT_DRIVER_ARG_LXC LIBVIRT_ARG_WITH([ESX], [ESX], [check]) LIBVIRT_ARG_WITH([HYPERV], [Hyper-V], [check]) LIBVIRT_DRIVER_ARG_TEST -LIBVIRT_ARG_WITH([REMOTE], [remote driver], [yes]) +LIBVIRT_DRIVER_ARG_REMOTE LIBVIRT_ARG_WITH([LIBVIRTD], [libvirtd], [yes]) dnl @@ -477,11 +477,7 @@ AM_CONDITIONAL([WITH_VBOX], [test "$with_vbox" = "yes"]) LIBVIRT_DRIVER_CHECK_QEMU LIBVIRT_DRIVER_CHECK_TEST - -if test "$with_remote" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_REMOTE], 1, [whether Remote driver is enabled]) -fi -AM_CONDITIONAL([WITH_REMOTE], [test "$with_remote" = "yes"]) +LIBVIRT_DRIVER_CHECK_REMOTE if test "$with_libvirtd" = "yes" ; then AC_DEFINE_UNQUOTED([WITH_LIBVIRTD], 1, [whether libvirtd daemon is enabled]) @@ -1370,7 +1366,7 @@ AC_MSG_NOTICE([ Hyper-V: $with_hyperv]) LIBVIRT_DRIVER_RESULT_VZ LIBVIRT_DRIVER_RESULT_BHYVE LIBVIRT_DRIVER_RESULT_TEST -AC_MSG_NOTICE([ Remote: $with_remote]) +LIBVIRT_DRIVER_RESULT_REMOTE AC_MSG_NOTICE([ Network: $with_network]) AC_MSG_NOTICE([ Libvirtd: $with_libvirtd]) AC_MSG_NOTICE([Interface: $with_interface]) diff --git a/m4/virt-driver-remote.m4 b/m4/virt-driver-remote.m4 new file mode 100644 index 0000000000..0b1f02e1a0 --- /dev/null +++ b/m4/virt-driver-remote.m4 @@ -0,0 +1,33 @@ +dnl The remote driver +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_DRIVER_ARG_REMOTE], [ + LIBVIRT_ARG_WITH([REMOTE], [remote driver], [yes]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_CHECK_REMOTE], [ + if test "$with_remote" = "yes" ; then + AC_DEFINE_UNQUOTED([WITH_REMOTE], 1, [whether Remote driver is enabled]) + fi + AM_CONDITIONAL([WITH_REMOTE], [test "$with_remote" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_RESULT_REMOTE], [ + LIBVIRT_RESULT([Remote], [$with_remote]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:35 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 10 +++------- m4/virt-driver-remote.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 m4/virt-driver-remote.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 24 +++--------------------- m4/virt-driver-vbox.m4 | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 21 deletions(-) create mode 100644 m4/virt-driver-vbox.m4 diff --git a/configure.ac b/configure.ac index 5f1c2013d2..1356568a09 100644 --- a/configure.ac +++ b/configure.ac @@ -405,7 +405,7 @@ LIBVIRT_DRIVER_ARG_VMWARE LIBVIRT_DRIVER_ARG_PHYP LIBVIRT_DRIVER_ARG_XENAPI LIBVIRT_DRIVER_ARG_LIBXL -LIBVIRT_ARG_WITH([VBOX], [VirtualBox XPCOMC], [yes]) +LIBVIRT_DRIVER_ARG_VBOX LIBVIRT_DRIVER_ARG_LXC LIBVIRT_ARG_WITH([ESX], [ESX], [check]) LIBVIRT_ARG_WITH([HYPERV], [Hyper-V], [check]) @@ -455,26 +455,8 @@ LIBVIRT_CHECK_SYSCTL_CONFIG LIBVIRT_DRIVER_CHECK_OPENVZ LIBVIRT_DRIVER_CHECK_VMWARE -dnl -dnl check for VirtualBox XPCOMC location -dnl - -vbox_xpcomc_dir= - -if test "x$with_vbox" != "xyes" && test "x$with_vbox" != "xno"; then - # intentionally don't do any further checks here on the provided path - vbox_xpcomc_dir=$with_vbox - with_vbox=yes -fi - -AC_DEFINE_UNQUOTED([VBOX_XPCOMC_DIR], ["$vbox_xpcomc_dir"], - [Location of directory containing VirtualBox XPCOMC library]) - -if test "x$with_vbox" = "xyes"; then - AC_DEFINE_UNQUOTED([WITH_VBOX], 1, [whether VirtualBox driver is enabled]) -fi -AM_CONDITIONAL([WITH_VBOX], [test "$with_vbox" = "yes"]) +LIBVIRT_DRIVER_CHECK_VBOX LIBVIRT_DRIVER_CHECK_QEMU LIBVIRT_DRIVER_CHECK_TEST LIBVIRT_DRIVER_CHECK_REMOTE @@ -1356,7 +1338,7 @@ LIBVIRT_DRIVER_RESULT_QEMU LIBVIRT_DRIVER_RESULT_UML LIBVIRT_DRIVER_RESULT_OPENVZ LIBVIRT_DRIVER_RESULT_VMWARE -AC_MSG_NOTICE([ VBox: $with_vbox]) +LIBVIRT_DRIVER_RESULT_VBOX LIBVIRT_DRIVER_RESULT_XENAPI LIBVIRT_DRIVER_RESULT_LIBXL LIBVIRT_DRIVER_RESULT_LXC diff --git a/m4/virt-driver-vbox.m4 b/m4/virt-driver-vbox.m4 new file mode 100644 index 0000000000..b84ce2271c --- /dev/null +++ b/m4/virt-driver-vbox.m4 @@ -0,0 +1,44 @@ +dnl The VirtualBox driver +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_DRIVER_ARG_VBOX], [ + LIBVIRT_ARG_WITH([VBOX], [VirtualBox XPCOMC], [yes]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_CHECK_VBOX], [ + vbox_xpcomc_dir= + + if test "x$with_vbox" != "xyes" && test "x$with_vbox" != "xno"; then + # intentionally don't do any further checks here on the provided path + vbox_xpcomc_dir=$with_vbox + with_vbox=yes + fi + + AC_DEFINE_UNQUOTED([VBOX_XPCOMC_DIR], ["$vbox_xpcomc_dir"], + [Location of directory containing VirtualBox XPCOMC library]) + + if test "x$with_vbox" = "xyes"; then + AC_DEFINE_UNQUOTED([WITH_VBOX], 1, [whether VirtualBox driver is enabled]) + fi + AM_CONDITIONAL([WITH_VBOX], [test "$with_vbox" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_RESULT_VBOX], [ + LIBVIRT_RESULT([VBox], [$with_vbox]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:36 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 24 +++--------------------- m4/virt-driver-vbox.m4 | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 21 deletions(-) create mode 100644 m4/virt-driver-vbox.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 31 +++------------------------- m4/virt-driver-esx.m4 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 28 deletions(-) create mode 100644 m4/virt-driver-esx.m4 diff --git a/configure.ac b/configure.ac index 1356568a09..879235cd1e 100644 --- a/configure.ac +++ b/configure.ac @@ -407,7 +407,7 @@ LIBVIRT_DRIVER_ARG_XENAPI LIBVIRT_DRIVER_ARG_LIBXL LIBVIRT_DRIVER_ARG_VBOX LIBVIRT_DRIVER_ARG_LXC -LIBVIRT_ARG_WITH([ESX], [ESX], [check]) +LIBVIRT_DRIVER_ARG_ESX LIBVIRT_ARG_WITH([HYPERV], [Hyper-V], [check]) LIBVIRT_DRIVER_ARG_TEST LIBVIRT_DRIVER_ARG_REMOTE @@ -973,32 +973,7 @@ dnl dnl check for (ESX) dnl -if test "$with_curl" != "yes" ; then - if test "$with_esx" != "yes"; then - with_esx=no - else - AC_MSG_ERROR([Curl is required for the ESX driver]) - fi -else - if test "$with_esx" = "check"; then - with_esx=yes - fi -fi - -if test "$with_esx" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_ESX], 1, [whether ESX driver is enabled]) -fi -AM_CONDITIONAL([WITH_ESX], [test "$with_esx" = "yes"]) - -with_vmx=yes -if test "$with_esx" != "yes" && test "$with_vmware" != "yes"; then - with_vmx=no -fi -if test "$with_vmx" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_VMX], 1, [whether VMware VMX config handling is enabled]) -fi -AM_CONDITIONAL([WITH_VMX], [test "$with_vmx" = "yes"]) - +LIBVIRT_DRIVER_CHECK_ESX dnl dnl check for Hyper-V @@ -1343,7 +1318,7 @@ LIBVIRT_DRIVER_RESULT_XENAPI LIBVIRT_DRIVER_RESULT_LIBXL LIBVIRT_DRIVER_RESULT_LXC LIBVIRT_DRIVER_RESULT_PHYP -AC_MSG_NOTICE([ ESX: $with_esx]) +LIBVIRT_DRIVER_RESULT_ESX AC_MSG_NOTICE([ Hyper-V: $with_hyperv]) LIBVIRT_DRIVER_RESULT_VZ LIBVIRT_DRIVER_RESULT_BHYVE diff --git a/m4/virt-driver-esx.m4 b/m4/virt-driver-esx.m4 new file mode 100644 index 0000000000..c751d6d350 --- /dev/null +++ b/m4/virt-driver-esx.m4 @@ -0,0 +1,57 @@ +dnl The ESX driver +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_DRIVER_ARG_ESX], [ + LIBVIRT_ARG_WITH([ESX], [ESX], [check]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_CHECK_ESX], [ + AC_REQUIRE([LIBVIRT_CHECK_CURL]) + AC_REQUIRE([LIBVIRT_DRIVER_CHECK_VMWARE]) + + if test "$with_curl" != "yes" ; then + if test "$with_esx" != "yes"; then + with_esx=no + else + AC_MSG_ERROR([Curl is required for the ESX driver]) + fi + else + if test "$with_esx" = "check"; then + with_esx=yes + fi + fi + + if test "$with_esx" = "yes" ; then + AC_DEFINE_UNQUOTED([WITH_ESX], 1, [whether ESX driver is enabled]) + fi + AM_CONDITIONAL([WITH_ESX], [test "$with_esx" = "yes"]) + + with_vmx=yes + if test "$with_esx" != "yes" && test "$with_vmware" != "yes"; then + with_vmx=no + fi + if test "$with_vmx" = "yes" ; then + AC_DEFINE_UNQUOTED([WITH_VMX], 1, [whether VMware VMX config handling is enabled]) + fi + AM_CONDITIONAL([WITH_VMX], [test "$with_vmx" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_RESULT_ESX], [ + LIBVIRT_RESULT([ESX], [$with_esx]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:37 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 31 +++------------------------- m4/virt-driver-esx.m4 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 28 deletions(-) create mode 100644 m4/virt-driver-esx.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 22 +++------------------- m4/virt-driver-hyperv.m4 | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 19 deletions(-) create mode 100644 m4/virt-driver-hyperv.m4 diff --git a/configure.ac b/configure.ac index 879235cd1e..56ad61a8ae 100644 --- a/configure.ac +++ b/configure.ac @@ -408,7 +408,7 @@ LIBVIRT_DRIVER_ARG_LIBXL LIBVIRT_DRIVER_ARG_VBOX LIBVIRT_DRIVER_ARG_LXC LIBVIRT_DRIVER_ARG_ESX -LIBVIRT_ARG_WITH([HYPERV], [Hyper-V], [check]) +LIBVIRT_DRIVER_ARG_HYPERV LIBVIRT_DRIVER_ARG_TEST LIBVIRT_DRIVER_ARG_REMOTE LIBVIRT_ARG_WITH([LIBVIRTD], [libvirtd], [yes]) @@ -979,23 +979,7 @@ dnl dnl check for Hyper-V dnl -if test "$with_hyperv" != "no"; then - if test "$with_openwsman" != "yes"; then - if test "$with_hyperv" = "check"; then - with_hyperv=no - else - AC_MSG_ERROR([openwsman is required for the Hyper-V driver]) - fi - else - with_hyperv=yes - fi -fi - -if test "$with_hyperv" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_HYPERV], 1, [whether Hyper-V driver is enabled]) -fi -AM_CONDITIONAL([WITH_HYPERV], [test "$with_hyperv" = "yes"]) - +LIBVIRT_DRIVER_CHECK_HYPERV dnl dnl check for kernel headers required by btrfs ioctl @@ -1319,7 +1303,7 @@ LIBVIRT_DRIVER_RESULT_LIBXL LIBVIRT_DRIVER_RESULT_LXC LIBVIRT_DRIVER_RESULT_PHYP LIBVIRT_DRIVER_RESULT_ESX -AC_MSG_NOTICE([ Hyper-V: $with_hyperv]) +LIBVIRT_DRIVER_RESULT_HYPERV LIBVIRT_DRIVER_RESULT_VZ LIBVIRT_DRIVER_RESULT_BHYVE LIBVIRT_DRIVER_RESULT_TEST diff --git a/m4/virt-driver-hyperv.m4 b/m4/virt-driver-hyperv.m4 new file mode 100644 index 0000000000..d99f8f6af5 --- /dev/null +++ b/m4/virt-driver-hyperv.m4 @@ -0,0 +1,47 @@ +dnl The Hyper-V driver +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_DRIVER_ARG_HYPERV], [ + LIBVIRT_ARG_WITH([HYPERV], [Hyper-V], [check]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_CHECK_HYPERV], [ + AC_REQUIRE([LIBVIRT_CHECK_OPENWSMAN]) + + if test "$with_hyperv" != "no"; then + if test "$with_openwsman" != "yes"; then + if test "$with_hyperv" = "check"; then + with_hyperv=no + else + AC_MSG_ERROR([openwsman is required for the Hyper-V driver]) + fi + else + with_hyperv=yes + fi + fi + + if test "$with_hyperv" = "yes" ; then + AC_DEFINE_UNQUOTED([WITH_HYPERV], 1, [whether Hyper-V driver is enabled]) + fi + AM_CONDITIONAL([WITH_HYPERV], [test "$with_hyperv" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_RESULT_HYPERV], [ + LIBVIRT_RESULT([Hyper-V], [$with_hyperv]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:38 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 22 +++------------------- m4/virt-driver-hyperv.m4 | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 19 deletions(-) create mode 100644 m4/virt-driver-hyperv.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 14 +++----------- m4/virt-driver-libvirtd.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 m4/virt-driver-libvirtd.m4 diff --git a/configure.ac b/configure.ac index 56ad61a8ae..50a7615400 100644 --- a/configure.ac +++ b/configure.ac @@ -411,7 +411,7 @@ LIBVIRT_DRIVER_ARG_ESX LIBVIRT_DRIVER_ARG_HYPERV LIBVIRT_DRIVER_ARG_TEST LIBVIRT_DRIVER_ARG_REMOTE -LIBVIRT_ARG_WITH([LIBVIRTD], [libvirtd], [yes]) +LIBVIRT_DRIVER_ARG_LIBVIRTD dnl dnl in case someone want to build static binaries @@ -460,12 +460,7 @@ LIBVIRT_DRIVER_CHECK_VBOX LIBVIRT_DRIVER_CHECK_QEMU LIBVIRT_DRIVER_CHECK_TEST LIBVIRT_DRIVER_CHECK_REMOTE - -if test "$with_libvirtd" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_LIBVIRTD], 1, [whether libvirtd daemon is enabled]) -fi -AM_CONDITIONAL([WITH_LIBVIRTD], [test "$with_libvirtd" = "yes"]) - +LIBVIRT_DRIVER_CHECK_LIBVIRTD LIBVIRT_DRIVER_CHECK_XENAPI LIBVIRT_DRIVER_CHECK_LIBXL LIBVIRT_DRIVER_CHECK_XEN @@ -1078,9 +1073,6 @@ if test "$enable_test_locking" = "yes"; then fi AM_CONDITIONAL([WITH_CIL],[test "$enable_test_locking" = "yes"]) -dnl Enable building libvirtd? -AM_CONDITIONAL([WITH_LIBVIRTD],[test "x$with_libvirtd" = "xyes"]) - dnl Check for gettext - don't go any newer than what RHEL 5 supports dnl dnl save and restore CPPFLAGS around gettext check as the internal iconv @@ -1309,7 +1301,7 @@ LIBVIRT_DRIVER_RESULT_BHYVE LIBVIRT_DRIVER_RESULT_TEST LIBVIRT_DRIVER_RESULT_REMOTE AC_MSG_NOTICE([ Network: $with_network]) -AC_MSG_NOTICE([ Libvirtd: $with_libvirtd]) +LIBVIRT_DRIVER_RESULT_LIBVIRTD AC_MSG_NOTICE([Interface: $with_interface]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) diff --git a/m4/virt-driver-libvirtd.m4 b/m4/virt-driver-libvirtd.m4 new file mode 100644 index 0000000000..5d82c1533f --- /dev/null +++ b/m4/virt-driver-libvirtd.m4 @@ -0,0 +1,33 @@ +dnl The libvirtd driver +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_DRIVER_ARG_LIBVIRTD], [ + LIBVIRT_ARG_WITH([LIBVIRTD], [libvirtd], [yes]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBVIRTD], [ + if test "$with_libvirtd" = "yes" ; then + AC_DEFINE_UNQUOTED([WITH_LIBVIRTD], 1, [whether libvirtd daemon is enabled]) + fi + AM_CONDITIONAL([WITH_LIBVIRTD], [test "$with_libvirtd" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_RESULT_LIBVIRTD], [ + LIBVIRT_RESULT([Libvirtd], [$with_libvirtd]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:39 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 14 +++----------- m4/virt-driver-libvirtd.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 m4/virt-driver-libvirtd.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 24 +++------------------- m4/virt-driver-network.m4 | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 21 deletions(-) create mode 100644 m4/virt-driver-network.m4 diff --git a/configure.ac b/configure.ac index 50a7615400..5fe6ec3038 100644 --- a/configure.ac +++ b/configure.ac @@ -607,26 +607,8 @@ LIBVIRT_DRIVER_CHECK_PHYP dnl check if the network driver should be compiled -LIBVIRT_ARG_WITH_ALT([NETWORK], [with virtual network driver], [yes]) - -dnl there's no use compiling the network driver without the libvirt -dnl daemon, nor compiling it for MacOS X, where it breaks the compile - -if test "$with_libvirtd" = "no" || test "$with_osx" = "yes"; then - with_network=no -fi - -if test "$with_network" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_NETWORK], 1, [whether network driver is enabled]) -fi -AM_CONDITIONAL([WITH_NETWORK], [test "$with_network" = "yes"]) - -with_bridge=no -if test "$with_qemu:$with_lxc:$with_network" != "no:no:no"; then - with_bridge=yes - AC_DEFINE_UNQUOTED([WITH_BRIDGE], 1, [whether bridge code is needed]) -fi -AM_CONDITIONAL([WITH_BRIDGE], [test "$with_bridge" = "yes"]) +LIBVIRT_DRIVER_ARG_NETWORK +LIBVIRT_DRIVER_CHECK_NETWORK LIBVIRT_ARG_WITH([SECRETS], [local secrets management driver], [yes]) @@ -1300,7 +1282,7 @@ LIBVIRT_DRIVER_RESULT_VZ LIBVIRT_DRIVER_RESULT_BHYVE LIBVIRT_DRIVER_RESULT_TEST LIBVIRT_DRIVER_RESULT_REMOTE -AC_MSG_NOTICE([ Network: $with_network]) +LIBVIRT_DRIVER_RESULT_NETWORK LIBVIRT_DRIVER_RESULT_LIBVIRTD AC_MSG_NOTICE([Interface: $with_interface]) AC_MSG_NOTICE([]) diff --git a/m4/virt-driver-network.m4 b/m4/virt-driver-network.m4 new file mode 100644 index 0000000000..ab7b9015ad --- /dev/null +++ b/m4/virt-driver-network.m4 @@ -0,0 +1,51 @@ +dnl The network driver +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_DRIVER_ARG_NETWORK], [ + LIBVIRT_ARG_WITH_ALT([NETWORK], [with virtual network driver], [yes]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_CHECK_NETWORK], [ + AC_REQUIRE([LIBVIRT_DRIVER_CHECK_LIBVIRTD]) + AC_REQUIRE([LIBVIRT_DRIVER_CHECK_QEMU]) + AC_REQUIRE([LIBVIRT_DRIVER_CHECK_LXC]) + + dnl there's no use compiling the network driver without the libvirt + dnl daemon, nor compiling it for MacOS X, where it breaks the compile + + if test "$with_libvirtd" = "no" || test "$with_osx" = "yes"; then + with_network=no + fi + + if test "$with_network" = "yes" ; then + AC_DEFINE_UNQUOTED([WITH_NETWORK], 1, [whether network driver is enabled]) + fi + AM_CONDITIONAL([WITH_NETWORK], [test "$with_network" = "yes"]) + + with_bridge=no + if test "$with_qemu:$with_lxc:$with_network" != "no:no:no"; then + with_bridge=yes + AC_DEFINE_UNQUOTED([WITH_BRIDGE], 1, [whether bridge code is needed]) + fi + AM_CONDITIONAL([WITH_BRIDGE], [test "$with_bridge" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_RESULT_NETWORK], [ + LIBVIRT_RESULT([Network], [$with_network]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:40 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 24 +++------------------- m4/virt-driver-network.m4 | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 21 deletions(-) create mode 100644 m4/virt-driver-network.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 23 +++------------------ m4/virt-driver-interface.m4 | 49 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 20 deletions(-) create mode 100644 m4/virt-driver-interface.m4 diff --git a/configure.ac b/configure.ac index 5fe6ec3038..f01e1b059f 100644 --- a/configure.ac +++ b/configure.ac @@ -1113,25 +1113,8 @@ fi AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"]) dnl check if the interface driver should be compiled -LIBVIRT_ARG_WITH([INTERFACE], [host interface driver], [check]) - -dnl Don't compile the interface driver without libvirtd -if test "$with_libvirtd" = "no" ; then - with_interface=no -fi - -dnl The interface driver depends on the netcf library or udev library -case $with_interface:$with_netcf:$with_udev in - check:*yes*) with_interface=yes ;; - check:no:no) with_interface=no ;; - yes:no:no) AC_MSG_ERROR([Requested the Interface driver without netcf or udev support]) ;; -esac - -if test "$with_interface" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_INTERFACE], [1], - [whether the interface driver is enabled]) -fi -AM_CONDITIONAL([WITH_INTERFACE], [test "$with_interface" = "yes"]) +LIBVIRT_DRIVER_ARG_INTERFACE +LIBVIRT_DRIVER_CHECK_INTERFACE dnl GET_VLAN_VID_CMD is required for virNetDevGetVLanID @@ -1284,7 +1267,7 @@ LIBVIRT_DRIVER_RESULT_TEST LIBVIRT_DRIVER_RESULT_REMOTE LIBVIRT_DRIVER_RESULT_NETWORK LIBVIRT_DRIVER_RESULT_LIBVIRTD -AC_MSG_NOTICE([Interface: $with_interface]) +LIBVIRT_DRIVER_RESULT_INTERFACE AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) diff --git a/m4/virt-driver-interface.m4 b/m4/virt-driver-interface.m4 new file mode 100644 index 0000000000..5b38516071 --- /dev/null +++ b/m4/virt-driver-interface.m4 @@ -0,0 +1,49 @@ +dnl The interface driver +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_DRIVER_ARG_INTERFACE], [ + LIBVIRT_ARG_WITH([INTERFACE], [host interface driver], [check]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_CHECK_INTERFACE], [ + AC_REQUIRE([LIBVIRT_DRIVER_CHECK_LIBVIRTD]) + AC_REQUIRE([LIBVIRT_CHECK_NETCF]) + AC_REQUIRE([LIBVIRT_CHECK_UDEV]) + + dnl Don't compile the interface driver without libvirtd + if test "$with_libvirtd" = "no" ; then + with_interface=no + fi + + dnl The interface driver depends on the netcf library or udev library + case $with_interface:$with_netcf:$with_udev in + check:*yes*) with_interface=yes ;; + check:no:no) with_interface=no ;; + yes:no:no) AC_MSG_ERROR([Requested the Interface driver without netcf or udev support]) ;; + esac + + if test "$with_interface" = "yes" ; then + AC_DEFINE_UNQUOTED([WITH_INTERFACE], [1], [whether the interface driver is enabled]) + fi + AM_CONDITIONAL([WITH_INTERFACE], [test "$with_interface" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_DRIVER_RESULT_INTERFACE], [ + LIBVIRT_RESULT([Interface], [$with_interface]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:41 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 23 +++------------------ m4/virt-driver-interface.m4 | 49 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 20 deletions(-) create mode 100644 m4/virt-driver-interface.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 2 -- m4/virt-driver-vz.m4 | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index f01e1b059f..15ea906305 100644 --- a/configure.ac +++ b/configure.ac @@ -109,8 +109,6 @@ then [Extra package version]) fi -dnl Required minimum versions of all libs we depend on -PARALLELS_SDK_REQUIRED="7.0.22" dnl Where we look for daemons and admin binaries during configure LIBVIRT_SBIN_PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin" diff --git a/m4/virt-driver-vz.m4 b/m4/virt-driver-vz.m4 index 74ef79a9a7..b3777494ab 100644 --- a/m4/virt-driver-vz.m4 +++ b/m4/virt-driver-vz.m4 @@ -22,6 +22,8 @@ AC_DEFUN([LIBVIRT_DRIVER_ARG_VZ],[ ]) AC_DEFUN([LIBVIRT_DRIVER_CHECK_VZ],[ + PARALLELS_SDK_REQUIRED="7.0.22" + if test "$with_vz" = "yes" || test "$with_vz" = "check"; then PKG_CHECK_MODULES([PARALLELS_SDK], [parallels-sdk >= $PARALLELS_SDK_REQUIRED], -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:42 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 2 -- m4/virt-driver-vz.m4 | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-)
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 96 ++++++++++++++++++++---------------------------------------- 1 file changed, 32 insertions(+), 64 deletions(-) diff --git a/configure.ac b/configure.ac index 15ea906305..80356bb93e 100644 --- a/configure.ac +++ b/configure.ac @@ -395,7 +395,10 @@ if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then sysconfdir='/etc' fi -dnl Allow to build without Xen, QEMU/KVM, test or remote driver +dnl +dnl Virtualization drivers check +dnl + LIBVIRT_DRIVER_ARG_XEN LIBVIRT_DRIVER_ARG_QEMU LIBVIRT_DRIVER_ARG_OPENVZ @@ -405,11 +408,39 @@ LIBVIRT_DRIVER_ARG_XENAPI LIBVIRT_DRIVER_ARG_LIBXL LIBVIRT_DRIVER_ARG_VBOX LIBVIRT_DRIVER_ARG_LXC +LIBVIRT_DRIVER_ARG_VZ +LIBVIRT_DRIVER_ARG_BHYVE +LIBVIRT_DRIVER_ARG_UML LIBVIRT_DRIVER_ARG_ESX LIBVIRT_DRIVER_ARG_HYPERV LIBVIRT_DRIVER_ARG_TEST LIBVIRT_DRIVER_ARG_REMOTE LIBVIRT_DRIVER_ARG_LIBVIRTD +LIBVIRT_DRIVER_ARG_NETWORK +LIBVIRT_DRIVER_ARG_INTERFACE + +LIBVIRT_DRIVER_CHECK_XEN +LIBVIRT_DRIVER_CHECK_QEMU +LIBVIRT_DRIVER_CHECK_OPENVZ +LIBVIRT_DRIVER_CHECK_VMWARE +LIBVIRT_DRIVER_CHECK_PHYP +LIBVIRT_DRIVER_CHECK_XENAPI +LIBVIRT_DRIVER_CHECK_LIBXL +LIBVIRT_DRIVER_CHECK_VBOX +LIBVIRT_DRIVER_CHECK_LXC +LIBVIRT_DRIVER_CHECK_VZ +LIBVIRT_DRIVER_CHECK_BHYVE +LIBVIRT_DRIVER_CHECK_UML +LIBVIRT_DRIVER_CHECK_ESX +LIBVIRT_DRIVER_CHECK_HYPERV +LIBVIRT_DRIVER_CHECK_TEST +LIBVIRT_DRIVER_CHECK_REMOTE +LIBVIRT_DRIVER_CHECK_LIBVIRTD +LIBVIRT_DRIVER_CHECK_NETWORK +LIBVIRT_DRIVER_CHECK_INTERFACE + +AM_CONDITIONAL([WITH_XENCONFIG], [test "$with_libxl" = "yes" || test "$with_xen" = "yes"]) + dnl dnl in case someone want to build static binaries @@ -450,44 +481,16 @@ LIBVIRT_CHECK_TLS_PRIORITY LIBVIRT_CHECK_SYSCTL_CONFIG -LIBVIRT_DRIVER_CHECK_OPENVZ -LIBVIRT_DRIVER_CHECK_VMWARE - - -LIBVIRT_DRIVER_CHECK_VBOX -LIBVIRT_DRIVER_CHECK_QEMU -LIBVIRT_DRIVER_CHECK_TEST -LIBVIRT_DRIVER_CHECK_REMOTE -LIBVIRT_DRIVER_CHECK_LIBVIRTD -LIBVIRT_DRIVER_CHECK_XENAPI -LIBVIRT_DRIVER_CHECK_LIBXL -LIBVIRT_DRIVER_CHECK_XEN -AM_CONDITIONAL([WITH_XENCONFIG], [test "$with_libxl" = "yes" || test "$with_xen" = "yes"]) dnl dnl check for kvm headers dnl AC_CHECK_HEADERS([linux/kvm.h]) -LIBVIRT_DRIVER_CHECK_LXC AM_CONDITIONAL([WITH_SETUID_RPC_CLIENT], [test "$with_lxc$with_login_shell" != "nono"]) -dnl -dnl Checks for the Parallels driver -dnl - -LIBVIRT_DRIVER_ARG_VZ -LIBVIRT_DRIVER_CHECK_VZ - -dnl -dnl Checks for bhyve driver -dnl - -LIBVIRT_DRIVER_ARG_BHYVE -LIBVIRT_DRIVER_CHECK_BHYVE - dnl dnl check for kernel headers required by src/bridge.c @@ -590,24 +593,6 @@ if test "$with_apparmor" = "no"; then fi AM_CONDITIONAL([WITH_APPARMOR_PROFILES], [test "$with_apparmor_profiles" != "no"]) -dnl -dnl Checks for the UML driver -dnl - -LIBVIRT_DRIVER_ARG_UML -LIBVIRT_DRIVER_CHECK_UML - -dnl -dnl check for PHYP -dnl - -LIBVIRT_DRIVER_CHECK_PHYP - -dnl check if the network driver should be compiled - -LIBVIRT_DRIVER_ARG_NETWORK -LIBVIRT_DRIVER_CHECK_NETWORK - LIBVIRT_ARG_WITH([SECRETS], [local secrets management driver], [yes]) @@ -945,18 +930,6 @@ fi AM_CONDITIONAL([WITH_STORAGE], [test "$with_storage" = "yes"]) dnl -dnl check for (ESX) -dnl - -LIBVIRT_DRIVER_CHECK_ESX - -dnl -dnl check for Hyper-V -dnl - -LIBVIRT_DRIVER_CHECK_HYPERV - -dnl dnl check for kernel headers required by btrfs ioctl dnl if test "$with_linux" = "yes"; then @@ -1110,11 +1083,6 @@ then fi AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"]) -dnl check if the interface driver should be compiled -LIBVIRT_DRIVER_ARG_INTERFACE -LIBVIRT_DRIVER_CHECK_INTERFACE - - dnl GET_VLAN_VID_CMD is required for virNetDevGetVLanID AC_CHECK_DECLS([GET_VLAN_VID_CMD], [], [], [[#include <linux/if_vlan.h>]]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:43 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 96 ++++++++++++++++++++---------------------------------------- 1 file changed, 32 insertions(+), 64 deletions(-)
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 39 +++------------------------ m4/virt-secdriver-selinux.m4 | 63 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 35 deletions(-) create mode 100644 m4/virt-secdriver-selinux.m4 diff --git a/configure.ac b/configure.ac index 80356bb93e..924647e124 100644 --- a/configure.ac +++ b/configure.ac @@ -536,40 +536,9 @@ dnl Need to test if pkg-config exists PKG_PROG_PKG_CONFIG -LIBVIRT_ARG_WITH_ALT([SECDRIVER_SELINUX], [use SELinux security driver], [check]) - -if test "$with_selinux" != "yes" ; then - if test "$with_secdriver_selinux" = "check" ; then - with_secdriver_selinux=no - fi - if test "$with_secdriver_selinux" != "no"; then - AC_MSG_ERROR([You must install the libselinux development package and enable SELinux with the --with-selinux=yes in order to compile libvirt --with-secdriver-selinux=yes]) - fi -elif test "$with_secdriver_selinux" != "no"; then - old_CFLAGS="$CFLAGS" - old_LIBS="$LIBS" - CFLAGS="$CFLAGS $SELINUX_CFLAGS" - LIBS="$CFLAGS $SELINUX_LIBS" - - fail=0 - AC_CHECK_FUNC([selinux_virtual_domain_context_path], [], [fail=1]) - AC_CHECK_FUNC([selinux_virtual_image_context_path], [], [fail=1]) - AC_CHECK_FUNCS([selinux_lxc_contexts_path]) - CFLAGS="$old_CFLAGS" - LIBS="$old_LIBS" - - if test "$fail" = "1" ; then - if test "$with_secdriver_selinux" = "check" ; then - with_secdriver_selinux=no - else - AC_MSG_ERROR([You must install libselinux development package >= 2.0.82 in order to compile libvirt --with-secdriver-selinux=yes]) - fi - else - with_secdriver_selinux=yes - AC_DEFINE_UNQUOTED([WITH_SECDRIVER_SELINUX], 1, [whether SELinux security driver is available]) - fi -fi -AM_CONDITIONAL([WITH_SECDRIVER_SELINUX], [test "$with_secdriver_selinux" != "no"]) +dnl Security driver checks +LIBVIRT_SECDRIVER_ARG_SELINUX +LIBVIRT_SECDRIVER_CHECK_SELINUX LIBVIRT_ARG_WITH_ALT([SECDRIVER_APPARMOR], [use AppArmor security driver], [check]) @@ -1252,7 +1221,7 @@ AC_MSG_NOTICE([ ZFS: $with_storage_zfs]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Security Drivers]) AC_MSG_NOTICE([]) -AC_MSG_NOTICE([ SELinux: $with_secdriver_selinux ($SELINUX_MOUNT)]) +LIBVIRT_SECDRIVER_RESULT_SELINUX AC_MSG_NOTICE([AppArmor: $with_secdriver_apparmor (install profiles: $with_apparmor_profiles)]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Driver Loadable Modules]) diff --git a/m4/virt-secdriver-selinux.m4 b/m4/virt-secdriver-selinux.m4 new file mode 100644 index 0000000000..f7220cbecf --- /dev/null +++ b/m4/virt-secdriver-selinux.m4 @@ -0,0 +1,63 @@ +dnl The SElinux security driver +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_SECDRIVER_ARG_SELINUX], [ + LIBVIRT_ARG_WITH_ALT([SECDRIVER_SELINUX], [use SELinux security driver], [check]) +]) + +AC_DEFUN([LIBVIRT_SECDRIVER_CHECK_SELINUX], [ + AC_REQUIRE([LIBVIRT_CHECK_SELINUX]) + + if test "$with_selinux" != "yes" ; then + if test "$with_secdriver_selinux" = "check" ; then + with_secdriver_selinux=no + fi + if test "$with_secdriver_selinux" != "no"; then + AC_MSG_ERROR([You must install the libselinux development package and enable SELinux with the --with-selinux=yes in order to compile libvirt --with-secdriver-selinux=yes]) + fi + elif test "$with_secdriver_selinux" != "no"; then + old_CFLAGS="$CFLAGS" + old_LIBS="$LIBS" + CFLAGS="$CFLAGS $SELINUX_CFLAGS" + LIBS="$CFLAGS $SELINUX_LIBS" + + fail=0 + AC_CHECK_FUNC([selinux_virtual_domain_context_path], [], [fail=1]) + AC_CHECK_FUNC([selinux_virtual_image_context_path], [], [fail=1]) + AC_CHECK_FUNCS([selinux_lxc_contexts_path]) + CFLAGS="$old_CFLAGS" + LIBS="$old_LIBS" + + if test "$fail" = "1" ; then + if test "$with_secdriver_selinux" = "check" ; then + with_secdriver_selinux=no + else + AC_MSG_ERROR([You must install libselinux development package >= 2.0.82 in order to compile libvirt --with-secdriver-selinux=yes]) + fi + else + with_secdriver_selinux=yes + AC_DEFINE_UNQUOTED([WITH_SECDRIVER_SELINUX], 1, [whether SELinux security driver is available]) + fi + fi + AM_CONDITIONAL([WITH_SECDRIVER_SELINUX], [test "$with_secdriver_selinux" != "no"]) +]) + +AC_DEFUN([LIBVIRT_SECDRIVER_RESULT_SELINUX], [ + LIBVIRT_RESULT([SELinux], [$with_secdriver_selinux]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:44 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 39 +++------------------------ m4/virt-secdriver-selinux.m4 | 63 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 35 deletions(-) create mode 100644 m4/virt-secdriver-selinux.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 27 ++++------------------- m4/virt-secdriver-apparmor.m4 | 50 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 23 deletions(-) create mode 100644 m4/virt-secdriver-apparmor.m4 diff --git a/configure.ac b/configure.ac index 924647e124..8fdd388bf0 100644 --- a/configure.ac +++ b/configure.ac @@ -538,29 +538,10 @@ PKG_PROG_PKG_CONFIG dnl Security driver checks LIBVIRT_SECDRIVER_ARG_SELINUX -LIBVIRT_SECDRIVER_CHECK_SELINUX - - -LIBVIRT_ARG_WITH_ALT([SECDRIVER_APPARMOR], [use AppArmor security driver], [check]) +LIBVIRT_SECDRIVER_ARG_APPARMOR -if test "$with_apparmor" != "yes" ; then - if test "$with_secdriver_apparmor" = "check" ; then - with_secdriver_apparmor=no - fi - if test "$with_secdriver_apparmor" != "no" ; then - AC_MSG_ERROR([You must install the AppArmor development package in order to compile libvirt]) - fi -elif test "with_secdriver_apparmor" != "no" ; then - with_secdriver_apparmor=yes - AC_DEFINE_UNQUOTED([WITH_SECDRIVER_APPARMOR], 1, [whether AppArmor security driver is available]) -fi -AM_CONDITIONAL([WITH_SECDRIVER_APPARMOR], [test "$with_secdriver_apparmor" != "no"]) - -LIBVIRT_ARG_WITH_ALT([APPARMOR_PROFILES], [install apparmor profiles], [no]) -if test "$with_apparmor" = "no"; then - with_apparmor_profiles="no" -fi -AM_CONDITIONAL([WITH_APPARMOR_PROFILES], [test "$with_apparmor_profiles" != "no"]) +LIBVIRT_SECDRIVER_CHECK_SELINUX +LIBVIRT_SECDRIVER_CHECK_APPARMOR LIBVIRT_ARG_WITH([SECRETS], [local secrets management driver], [yes]) @@ -1222,7 +1203,7 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Security Drivers]) AC_MSG_NOTICE([]) LIBVIRT_SECDRIVER_RESULT_SELINUX -AC_MSG_NOTICE([AppArmor: $with_secdriver_apparmor (install profiles: $with_apparmor_profiles)]) +LIBVIRT_SECDRIVER_RESULT_APPARMOR AC_MSG_NOTICE([]) AC_MSG_NOTICE([Driver Loadable Modules]) AC_MSG_NOTICE([]) diff --git a/m4/virt-secdriver-apparmor.m4 b/m4/virt-secdriver-apparmor.m4 new file mode 100644 index 0000000000..d3d96ec7e2 --- /dev/null +++ b/m4/virt-secdriver-apparmor.m4 @@ -0,0 +1,50 @@ +dnl The AppArmor security driver +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_SECDRIVER_ARG_APPARMOR], [ + LIBVIRT_ARG_WITH_ALT([SECDRIVER_APPARMOR], [use AppArmor security driver], [check]) +]) + +AC_DEFUN([LIBVIRT_SECDRIVER_CHECK_APPARMOR], [ + AC_REQUIRE([LIBVIRT_CHECK_APPARMOR]) + + if test "$with_apparmor" != "yes" ; then + if test "$with_secdriver_apparmor" = "check" ; then + with_secdriver_apparmor=no + fi + if test "$with_secdriver_apparmor" != "no" ; then + AC_MSG_ERROR([You must install the AppArmor development package in order to compile libvirt]) + fi + elif test "with_secdriver_apparmor" != "no" ; then + with_secdriver_apparmor=yes + AC_DEFINE_UNQUOTED([WITH_SECDRIVER_APPARMOR], 1, [whether AppArmor security driver is available]) + fi + AM_CONDITIONAL([WITH_SECDRIVER_APPARMOR], [test "$with_secdriver_apparmor" != "no"]) + + LIBVIRT_ARG_WITH_ALT([APPARMOR_PROFILES], [install apparmor profiles], [no]) + if test "$with_apparmor" = "no"; then + with_apparmor_profiles="no" + fi + AM_CONDITIONAL([WITH_APPARMOR_PROFILES], [test "$with_apparmor_profiles" != "no"]) +]) + +AC_DEFUN([LIBVIRT_SECDRIVER_RESULT_APPARMOR], [ + LIBVIRT_RESULT([AppArmor], [$with_secdriver_apparmor], + [install profiles: $with_apparmor_profiles]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:45 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 27 ++++------------------- m4/virt-secdriver-apparmor.m4 | 50 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 23 deletions(-) create mode 100644 m4/virt-secdriver-apparmor.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 10 ++++------ m4/virt-storage-dir.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 m4/virt-storage-dir.m4 diff --git a/configure.ac b/configure.ac index 8fdd388bf0..63cbae8bc2 100644 --- a/configure.ac +++ b/configure.ac @@ -555,7 +555,7 @@ fi AM_CONDITIONAL([WITH_SECRETS], [test "$with_secrets" = "yes"]) -LIBVIRT_ARG_WITH([STORAGE_DIR], [directory backend for the storage driver], [yes]) +LIBVIRT_STORAGE_ARG_DIR LIBVIRT_ARG_WITH([STORAGE_FS], [FileSystem backend for the storage driver], [check]) LIBVIRT_ARG_WITH([STORAGE_LVM], [LVM backend for storage driver], [check]) LIBVIRT_ARG_WITH([STORAGE_ISCSI], [iSCSI backend for the storage driver], [check]) @@ -580,10 +580,8 @@ if test "$with_libvirtd" = "no"; then with_storage_gluster=no with_storage_zfs=no fi -if test "$with_storage_dir" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_STORAGE_DIR], 1, [whether directory backend for storage driver is enabled]) -fi -AM_CONDITIONAL([WITH_STORAGE_DIR], [test "$with_storage_dir" = "yes"]) + +LIBVIRT_STORAGE_CHECK_DIR dnl storage-fs does not work on MacOS X @@ -1187,7 +1185,7 @@ LIBVIRT_DRIVER_RESULT_INTERFACE AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) -AC_MSG_NOTICE([ Dir: $with_storage_dir]) +LIBVIRT_STORAGE_RESULT_DIR AC_MSG_NOTICE([ FS: $with_storage_fs]) AC_MSG_NOTICE([ NetFS: $with_storage_fs]) AC_MSG_NOTICE([ LVM: $with_storage_lvm]) diff --git a/m4/virt-storage-dir.m4 b/m4/virt-storage-dir.m4 new file mode 100644 index 0000000000..0f6880ddaf --- /dev/null +++ b/m4/virt-storage-dir.m4 @@ -0,0 +1,33 @@ +dnl The storage dir check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_STORAGE_ARG_DIR], [ + LIBVIRT_ARG_WITH([STORAGE_DIR], [directory backend for the storage driver], [yes]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_CHECK_DIR], [ + if test "$with_storage_dir" = "yes" ; then + AC_DEFINE_UNQUOTED([WITH_STORAGE_DIR], 1, [whether directory backend for storage driver is enabled]) + fi + AM_CONDITIONAL([WITH_STORAGE_DIR], [test "$with_storage_dir" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_RESULT_DIR], [ + LIBVIRT_RESULT([Dir], [$with_storage_dir]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:46 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 10 ++++------ m4/virt-storage-dir.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 m4/virt-storage-dir.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 50 ++--------------------------- m4/virt-storage-fs.m4 | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 47 deletions(-) create mode 100644 m4/virt-storage-fs.m4 diff --git a/configure.ac b/configure.ac index 63cbae8bc2..6fb45c5e85 100644 --- a/configure.ac +++ b/configure.ac @@ -556,7 +556,7 @@ AM_CONDITIONAL([WITH_SECRETS], [test "$with_secrets" = "yes"]) LIBVIRT_STORAGE_ARG_DIR -LIBVIRT_ARG_WITH([STORAGE_FS], [FileSystem backend for the storage driver], [check]) +LIBVIRT_STORAGE_ARG_FS LIBVIRT_ARG_WITH([STORAGE_LVM], [LVM backend for storage driver], [check]) LIBVIRT_ARG_WITH([STORAGE_ISCSI], [iSCSI backend for the storage driver], [check]) LIBVIRT_ARG_WITH([STORAGE_SCSI], [SCSI backend for the storage driver], [check]) @@ -589,50 +589,7 @@ if test "$with_osx" = "yes"; then with_storage_fs=no fi -if test "$with_storage_fs" = "yes" || test "$with_storage_fs" = "check"; then - AC_CHECK_HEADER([mntent.h],, - [ - if test "$with_storage_fs" = "check"; then - with_storage_fs=no - AC_MSG_NOTICE([<mntent.h> is required for the FS storage driver, disabling it]) - else - AC_MSG_ERROR([<mntent.h> is required for the FS storage driver]) - fi - ]) -fi - -if test "$with_storage_fs" = "yes" || test "$with_storage_fs" = "check"; then - AC_PATH_PROG([MOUNT], [mount], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([UMOUNT], [umount], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([MKFS], [mkfs], [], [$LIBVIRT_SBIN_PATH]) - if test "$with_storage_fs" = "yes" ; then - if test -z "$MOUNT" ; then AC_MSG_ERROR([We need mount for FS storage driver]) ; fi - if test -z "$UMOUNT" ; then AC_MSG_ERROR([We need umount for FS storage driver]) ; fi - if test -z "$MKFS" ; then AC_MSG_ERROR([We need mkfs for FS storage driver]) ; fi - else - if test -z "$MOUNT" ; then with_storage_fs=no ; fi - if test -z "$UMOUNT" ; then with_storage_fs=no ; fi - if test -z "$MKFS" ; then with_storage_fs=no ; fi - - if test "$with_storage_fs" = "check" ; then with_storage_fs=yes ; fi - fi - - if test "$with_storage_fs" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_STORAGE_FS], 1, [whether FS backend for storage driver is enabled]) - AC_DEFINE_UNQUOTED([MOUNT],["$MOUNT"], - [Location or name of the mount program]) - AC_DEFINE_UNQUOTED([UMOUNT],["$UMOUNT"], - [Location or name of the mount program]) - AC_DEFINE_UNQUOTED([MKFS],["$MKFS"], - [Location or name of the mkfs program]) - fi -fi -AM_CONDITIONAL([WITH_STORAGE_FS], [test "$with_storage_fs" = "yes"]) -if test "$with_storage_fs" = "yes"; then - AC_PATH_PROG([SHOWMOUNT], [showmount], [], [$LIBVIRT_SBIN_PATH]) - AC_DEFINE_UNQUOTED([SHOWMOUNT], ["$SHOWMOUNT"], - [Location or name of the showmount program]) -fi +LIBVIRT_STORAGE_CHECK_FS if test "$with_storage_lvm" = "yes" || test "$with_storage_lvm" = "check"; then AC_PATH_PROG([PVCREATE], [pvcreate], [], [$LIBVIRT_SBIN_PATH]) @@ -1186,8 +1143,7 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) LIBVIRT_STORAGE_RESULT_DIR -AC_MSG_NOTICE([ FS: $with_storage_fs]) -AC_MSG_NOTICE([ NetFS: $with_storage_fs]) +LIBVIRT_STORAGE_RESULT_FS AC_MSG_NOTICE([ LVM: $with_storage_lvm]) AC_MSG_NOTICE([ iSCSI: $with_storage_iscsi]) AC_MSG_NOTICE([ SCSI: $with_storage_scsi]) diff --git a/m4/virt-storage-fs.m4 b/m4/virt-storage-fs.m4 new file mode 100644 index 0000000000..f2c7130dc4 --- /dev/null +++ b/m4/virt-storage-fs.m4 @@ -0,0 +1,89 @@ +dnl The storage fs check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_STORAGE_ARG_FS], [ + LIBVIRT_ARG_WITH([STORAGE_FS], [FileSystem backend for the storage driver], + [check]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_CHECK_FS], [ + if test "$with_storage_fs" = "yes" || test "$with_storage_fs" = "check"; then + AC_CHECK_HEADER([mntent.h], , [ + if test "$with_storage_fs" = "check"; then + with_storage_fs=no + AC_MSG_NOTICE([<mntent.h> is required for the FS storage driver, disabling it]) + else + AC_MSG_ERROR([<mntent.h> is required for the FS storage driver]) + fi + ]) + fi + + if test "$with_storage_fs" = "yes" || test "$with_storage_fs" = "check"; then + AC_PATH_PROG([MOUNT], [mount], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([UMOUNT], [umount], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([MKFS], [mkfs], [], [$LIBVIRT_SBIN_PATH]) + if test "$with_storage_fs" = "yes" ; then + if test -z "$MOUNT" ; then + AC_MSG_ERROR([We need mount for FS storage driver]) + fi + if test -z "$UMOUNT" ; then + AC_MSG_ERROR([We need umount for FS storage driver]) + fi + if test -z "$MKFS" ; then + AC_MSG_ERROR([We need mkfs for FS storage driver]) + fi + else + if test -z "$MOUNT" ; then + with_storage_fs=no + fi + if test -z "$UMOUNT" ; then + with_storage_fs=no + fi + if test -z "$MKFS" ; then + with_storage_fs=no + fi + + if test "$with_storage_fs" = "check" ; then + with_storage_fs=yes + fi + fi + + if test "$with_storage_fs" = "yes" ; then + AC_DEFINE_UNQUOTED([WITH_STORAGE_FS], 1, + [whether FS backend for storage driver is enabled]) + AC_DEFINE_UNQUOTED([MOUNT], ["$MOUNT"], + [Location or name of the mount program]) + AC_DEFINE_UNQUOTED([UMOUNT], ["$UMOUNT"], + [Location or name of the mount program]) + AC_DEFINE_UNQUOTED([MKFS], ["$MKFS"], + [Location or name of the mkfs program]) + fi + fi + AM_CONDITIONAL([WITH_STORAGE_FS], [test "$with_storage_fs" = "yes"]) + if test "$with_storage_fs" = "yes"; then + AC_PATH_PROG([SHOWMOUNT], [showmount], [], [$LIBVIRT_SBIN_PATH]) + AC_DEFINE_UNQUOTED([SHOWMOUNT], ["$SHOWMOUNT"], + [Location or name of the showmount program]) + fi +]) + +AC_DEFUN([LIBVIRT_STORAGE_RESULT_FS], [ + LIBVIRT_RESULT([FS], [$with_storage_fs]) + LIBVIRT_RESULT([NetFS], [$with_storage_fs]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:47 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 50 ++--------------------------- m4/virt-storage-fs.m4 | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 47 deletions(-) create mode 100644 m4/virt-storage-fs.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 68 ++------------------------------------ m4/virt-storage-lvm.m4 | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 65 deletions(-) create mode 100644 m4/virt-storage-lvm.m4 diff --git a/configure.ac b/configure.ac index 6fb45c5e85..4a5324936b 100644 --- a/configure.ac +++ b/configure.ac @@ -557,7 +557,7 @@ AM_CONDITIONAL([WITH_SECRETS], [test "$with_secrets" = "yes"]) LIBVIRT_STORAGE_ARG_DIR LIBVIRT_STORAGE_ARG_FS -LIBVIRT_ARG_WITH([STORAGE_LVM], [LVM backend for storage driver], [check]) +LIBVIRT_STORAGE_ARG_LVM LIBVIRT_ARG_WITH([STORAGE_ISCSI], [iSCSI backend for the storage driver], [check]) LIBVIRT_ARG_WITH([STORAGE_SCSI], [SCSI backend for the storage driver], [check]) LIBVIRT_ARG_WITH([STORAGE_MPATH], [mpath backend for the storage driver], [check]) @@ -590,69 +590,7 @@ if test "$with_osx" = "yes"; then fi LIBVIRT_STORAGE_CHECK_FS - -if test "$with_storage_lvm" = "yes" || test "$with_storage_lvm" = "check"; then - AC_PATH_PROG([PVCREATE], [pvcreate], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([VGCREATE], [vgcreate], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([LVCREATE], [lvcreate], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([PVREMOVE], [pvremove], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([VGREMOVE], [vgremove], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([LVREMOVE], [lvremove], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([LVCHANGE], [lvchange], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([VGCHANGE], [vgchange], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([VGSCAN], [vgscan], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([PVS], [pvs], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([VGS], [vgs], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([LVS], [lvs], [], [$LIBVIRT_SBIN_PATH]) - - if test "$with_storage_lvm" = "yes" ; then - if test -z "$PVCREATE" ; then AC_MSG_ERROR([We need pvcreate for LVM storage driver]) ; fi - if test -z "$VGCREATE" ; then AC_MSG_ERROR([We need vgcreate for LVM storage driver]) ; fi - if test -z "$LVCREATE" ; then AC_MSG_ERROR([We need lvcreate for LVM storage driver]) ; fi - if test -z "$PVREMOVE" ; then AC_MSG_ERROR([We need pvremove for LVM storage driver]) ; fi - if test -z "$VGREMOVE" ; then AC_MSG_ERROR([We need vgremove for LVM storage driver]) ; fi - if test -z "$LVREMOVE" ; then AC_MSG_ERROR([We need lvremove for LVM storage driver]) ; fi - if test -z "$LVCHANGE" ; then AC_MSG_ERROR([We need lvchange for LVM storage driver]) ; fi - if test -z "$VGCHANGE" ; then AC_MSG_ERROR([We need vgchange for LVM storage driver]) ; fi - if test -z "$VGSCAN" ; then AC_MSG_ERROR([We need vgscan for LVM storage driver]) ; fi - if test -z "$PVS" ; then AC_MSG_ERROR([We need pvs for LVM storage driver]) ; fi - if test -z "$VGS" ; then AC_MSG_ERROR([We need vgs for LVM storage driver]) ; fi - if test -z "$LVS" ; then AC_MSG_ERROR([We need lvs for LVM storage driver]) ; fi - else - if test -z "$PVCREATE" ; then with_storage_lvm=no ; fi - if test -z "$VGCREATE" ; then with_storage_lvm=no ; fi - if test -z "$LVCREATE" ; then with_storage_lvm=no ; fi - if test -z "$PVREMOVE" ; then with_storage_lvm=no ; fi - if test -z "$VGREMOVE" ; then with_storage_lvm=no ; fi - if test -z "$LVREMOVE" ; then with_storage_lvm=no ; fi - if test -z "$LVCHANGE" ; then with_storage_lvm=no ; fi - if test -z "$VGCHANGE" ; then with_storage_lvm=no ; fi - if test -z "$VGSCAN" ; then with_storage_lvm=no ; fi - if test -z "$PVS" ; then with_storage_lvm=no ; fi - if test -z "$VGS" ; then with_storage_lvm=no ; fi - if test -z "$LVS" ; then with_storage_lvm=no ; fi - - if test "$with_storage_lvm" = "check" ; then with_storage_lvm=yes ; fi - fi - - if test "$with_storage_lvm" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_STORAGE_LVM], 1, [whether LVM backend for storage driver is enabled]) - AC_DEFINE_UNQUOTED([PVCREATE],["$PVCREATE"],[Location of pvcreate program]) - AC_DEFINE_UNQUOTED([VGCREATE],["$VGCREATE"],[Location of vgcreate program]) - AC_DEFINE_UNQUOTED([LVCREATE],["$LVCREATE"],[Location of lvcreate program]) - AC_DEFINE_UNQUOTED([PVREMOVE],["$PVREMOVE"],[Location of pvremove program]) - AC_DEFINE_UNQUOTED([VGREMOVE],["$VGREMOVE"],[Location of vgremove program]) - AC_DEFINE_UNQUOTED([LVREMOVE],["$LVREMOVE"],[Location of lvremove program]) - AC_DEFINE_UNQUOTED([LVCHANGE],["$LVCHANGE"],[Location of lvchange program]) - AC_DEFINE_UNQUOTED([VGCHANGE],["$VGCHANGE"],[Location of vgchange program]) - AC_DEFINE_UNQUOTED([VGSCAN],["$VGSCAN"],[Location of vgscan program]) - AC_DEFINE_UNQUOTED([PVS],["$PVS"],[Location of pvs program]) - AC_DEFINE_UNQUOTED([VGS],["$VGS"],[Location of vgs program]) - AC_DEFINE_UNQUOTED([LVS],["$LVS"],[Location of lvs program]) - fi -fi -AM_CONDITIONAL([WITH_STORAGE_LVM], [test "$with_storage_lvm" = "yes"]) - +LIBVIRT_STORAGE_CHECK_LVM if test "$with_storage_iscsi" = "yes" || test "$with_storage_iscsi" = "check"; then @@ -1144,7 +1082,7 @@ AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) LIBVIRT_STORAGE_RESULT_DIR LIBVIRT_STORAGE_RESULT_FS -AC_MSG_NOTICE([ LVM: $with_storage_lvm]) +LIBVIRT_STORAGE_RESULT_LVM AC_MSG_NOTICE([ iSCSI: $with_storage_iscsi]) AC_MSG_NOTICE([ SCSI: $with_storage_scsi]) AC_MSG_NOTICE([ mpath: $with_storage_mpath]) diff --git a/m4/virt-storage-lvm.m4 b/m4/virt-storage-lvm.m4 new file mode 100644 index 0000000000..a393743f18 --- /dev/null +++ b/m4/virt-storage-lvm.m4 @@ -0,0 +1,90 @@ +dnl The storage LVM check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_STORAGE_ARG_LVM], [ + LIBVIRT_ARG_WITH([STORAGE_LVM], [LVM backend for storage driver], [check]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_CHECK_LVM], [ + if test "$with_storage_lvm" = "yes" || test "$with_storage_lvm" = "check"; then + AC_PATH_PROG([PVCREATE], [pvcreate], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([VGCREATE], [vgcreate], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([LVCREATE], [lvcreate], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([PVREMOVE], [pvremove], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([VGREMOVE], [vgremove], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([LVREMOVE], [lvremove], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([LVCHANGE], [lvchange], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([VGCHANGE], [vgchange], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([VGSCAN], [vgscan], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([PVS], [pvs], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([VGS], [vgs], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([LVS], [lvs], [], [$LIBVIRT_SBIN_PATH]) + + if test "$with_storage_lvm" = "yes" ; then + if test -z "$PVCREATE" ; then AC_MSG_ERROR([We need pvcreate for LVM storage driver]) ; fi + if test -z "$VGCREATE" ; then AC_MSG_ERROR([We need vgcreate for LVM storage driver]) ; fi + if test -z "$LVCREATE" ; then AC_MSG_ERROR([We need lvcreate for LVM storage driver]) ; fi + if test -z "$PVREMOVE" ; then AC_MSG_ERROR([We need pvremove for LVM storage driver]) ; fi + if test -z "$VGREMOVE" ; then AC_MSG_ERROR([We need vgremove for LVM storage driver]) ; fi + if test -z "$LVREMOVE" ; then AC_MSG_ERROR([We need lvremove for LVM storage driver]) ; fi + if test -z "$LVCHANGE" ; then AC_MSG_ERROR([We need lvchange for LVM storage driver]) ; fi + if test -z "$VGCHANGE" ; then AC_MSG_ERROR([We need vgchange for LVM storage driver]) ; fi + if test -z "$VGSCAN" ; then AC_MSG_ERROR([We need vgscan for LVM storage driver]) ; fi + if test -z "$PVS" ; then AC_MSG_ERROR([We need pvs for LVM storage driver]) ; fi + if test -z "$VGS" ; then AC_MSG_ERROR([We need vgs for LVM storage driver]) ; fi + if test -z "$LVS" ; then AC_MSG_ERROR([We need lvs for LVM storage driver]) ; fi + else + if test -z "$PVCREATE" ; then with_storage_lvm=no ; fi + if test -z "$VGCREATE" ; then with_storage_lvm=no ; fi + if test -z "$LVCREATE" ; then with_storage_lvm=no ; fi + if test -z "$PVREMOVE" ; then with_storage_lvm=no ; fi + if test -z "$VGREMOVE" ; then with_storage_lvm=no ; fi + if test -z "$LVREMOVE" ; then with_storage_lvm=no ; fi + if test -z "$LVCHANGE" ; then with_storage_lvm=no ; fi + if test -z "$VGCHANGE" ; then with_storage_lvm=no ; fi + if test -z "$VGSCAN" ; then with_storage_lvm=no ; fi + if test -z "$PVS" ; then with_storage_lvm=no ; fi + if test -z "$VGS" ; then with_storage_lvm=no ; fi + if test -z "$LVS" ; then with_storage_lvm=no ; fi + + if test "$with_storage_lvm" = "check" ; then with_storage_lvm=yes ; fi + fi + + if test "$with_storage_lvm" = "yes" ; then + AC_DEFINE_UNQUOTED([WITH_STORAGE_LVM], 1, [whether LVM backend for storage driver is enabled]) + AC_DEFINE_UNQUOTED([PVCREATE],["$PVCREATE"],[Location of pvcreate program]) + AC_DEFINE_UNQUOTED([VGCREATE],["$VGCREATE"],[Location of vgcreate program]) + AC_DEFINE_UNQUOTED([LVCREATE],["$LVCREATE"],[Location of lvcreate program]) + AC_DEFINE_UNQUOTED([PVREMOVE],["$PVREMOVE"],[Location of pvremove program]) + AC_DEFINE_UNQUOTED([VGREMOVE],["$VGREMOVE"],[Location of vgremove program]) + AC_DEFINE_UNQUOTED([LVREMOVE],["$LVREMOVE"],[Location of lvremove program]) + AC_DEFINE_UNQUOTED([LVCHANGE],["$LVCHANGE"],[Location of lvchange program]) + AC_DEFINE_UNQUOTED([VGCHANGE],["$VGCHANGE"],[Location of vgchange program]) + AC_DEFINE_UNQUOTED([VGSCAN],["$VGSCAN"],[Location of vgscan program]) + AC_DEFINE_UNQUOTED([PVS],["$PVS"],[Location of pvs program]) + AC_DEFINE_UNQUOTED([VGS],["$VGS"],[Location of vgs program]) + AC_DEFINE_UNQUOTED([LVS],["$LVS"],[Location of lvs program]) + fi + fi + AM_CONDITIONAL([WITH_STORAGE_LVM], [test "$with_storage_lvm" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_RESULT_LVM], [ + LIBVIRT_RESULT([LVM], [$with_storage_lvm]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:48 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 68 ++------------------------------------ m4/virt-storage-lvm.m4 | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 65 deletions(-) create mode 100644 m4/virt-storage-lvm.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 26 +++---------------------- m4/virt-storage-iscsi.m4 | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 23 deletions(-) create mode 100644 m4/virt-storage-iscsi.m4 diff --git a/configure.ac b/configure.ac index 4a5324936b..e39530447c 100644 --- a/configure.ac +++ b/configure.ac @@ -558,7 +558,7 @@ AM_CONDITIONAL([WITH_SECRETS], [test "$with_secrets" = "yes"]) LIBVIRT_STORAGE_ARG_DIR LIBVIRT_STORAGE_ARG_FS LIBVIRT_STORAGE_ARG_LVM -LIBVIRT_ARG_WITH([STORAGE_ISCSI], [iSCSI backend for the storage driver], [check]) +LIBVIRT_STORAGE_ARG_ISCSI LIBVIRT_ARG_WITH([STORAGE_SCSI], [SCSI backend for the storage driver], [check]) LIBVIRT_ARG_WITH([STORAGE_MPATH], [mpath backend for the storage driver], [check]) LIBVIRT_ARG_WITH([STORAGE_DISK], [GPartd Disk backend for the storage driver], [check]) @@ -591,29 +591,9 @@ fi LIBVIRT_STORAGE_CHECK_FS LIBVIRT_STORAGE_CHECK_LVM +LIBVIRT_STORAGE_CHECK_ISCSI -if test "$with_storage_iscsi" = "yes" || test "$with_storage_iscsi" = "check"; then - AC_PATH_PROG([ISCSIADM], [iscsiadm], [], [$LIBVIRT_SBIN_PATH]) - if test "$with_storage_iscsi" = "yes" ; then - if test -z "$ISCSIADM" ; then AC_MSG_ERROR([We need iscsiadm for iSCSI storage driver]) ; fi - else - if test -z "$ISCSIADM" ; then with_storage_iscsi=no ; fi - - if test "$with_storage_iscsi" = "check" ; then with_storage_iscsi=yes ; fi - fi - - if test "$with_storage_iscsi" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_STORAGE_ISCSI], 1, [whether iSCSI backend for storage driver is enabled]) - fi -fi -if test -z "$ISCIADM" ; then - AC_DEFINE_UNQUOTED([ISCSIADM],["iscsiadm"],[Name of iscsiadm program]) -else - AC_DEFINE_UNQUOTED([ISCSIADM],["$ISCSIADM"],[Location of iscsiadm program]) -fi -AM_CONDITIONAL([WITH_STORAGE_ISCSI], [test "$with_storage_iscsi" = "yes"]) - if test "$with_storage_scsi" = "check" || test "$with_storage_scsi" = "yes"; then with_storage_scsi=yes @@ -1083,7 +1063,7 @@ AC_MSG_NOTICE([]) LIBVIRT_STORAGE_RESULT_DIR LIBVIRT_STORAGE_RESULT_FS LIBVIRT_STORAGE_RESULT_LVM -AC_MSG_NOTICE([ iSCSI: $with_storage_iscsi]) +LIBVIRT_STORAGE_RESULT_ISCSI AC_MSG_NOTICE([ SCSI: $with_storage_scsi]) AC_MSG_NOTICE([ mpath: $with_storage_mpath]) AC_MSG_NOTICE([ Disk: $with_storage_disk]) diff --git a/m4/virt-storage-iscsi.m4 b/m4/virt-storage-iscsi.m4 new file mode 100644 index 0000000000..6ad61fc732 --- /dev/null +++ b/m4/virt-storage-iscsi.m4 @@ -0,0 +1,50 @@ +dnl The storage iSCSI check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_STORAGE_ARG_ISCSI], [ + LIBVIRT_ARG_WITH([STORAGE_ISCSI], [iSCSI backend for the storage driver], + [check]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_CHECK_ISCSI], [ + if test "$with_storage_iscsi" = "yes" || test "$with_storage_iscsi" = "check"; then + AC_PATH_PROG([ISCSIADM], [iscsiadm], [], [$LIBVIRT_SBIN_PATH]) + if test "$with_storage_iscsi" = "yes" ; then + if test -z "$ISCSIADM" ; then AC_MSG_ERROR([We need iscsiadm for iSCSI storage driver]) ; fi + else + if test -z "$ISCSIADM" ; then with_storage_iscsi=no ; fi + + if test "$with_storage_iscsi" = "check" ; then with_storage_iscsi=yes ; fi + fi + + if test "$with_storage_iscsi" = "yes" ; then + AC_DEFINE_UNQUOTED([WITH_STORAGE_ISCSI], 1, [whether iSCSI backend for storage driver is enabled]) + fi + fi + if test -z "$ISCIADM" ; then + AC_DEFINE_UNQUOTED([ISCSIADM],["iscsiadm"],[Name of iscsiadm program]) + else + AC_DEFINE_UNQUOTED([ISCSIADM],["$ISCSIADM"],[Location of iscsiadm program]) + fi + AM_CONDITIONAL([WITH_STORAGE_ISCSI], [test "$with_storage_iscsi" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_RESULT_ISCSI], [ + LIBVIRT_RESULT([iSCSI], [$with_storage_iscsi]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:49 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 26 +++---------------------- m4/virt-storage-iscsi.m4 | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 23 deletions(-) create mode 100644 m4/virt-storage-iscsi.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 13 +++---------- m4/virt-storage-scsi.m4 | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 m4/virt-storage-scsi.m4 diff --git a/configure.ac b/configure.ac index e39530447c..8952247c97 100644 --- a/configure.ac +++ b/configure.ac @@ -559,7 +559,7 @@ LIBVIRT_STORAGE_ARG_DIR LIBVIRT_STORAGE_ARG_FS LIBVIRT_STORAGE_ARG_LVM LIBVIRT_STORAGE_ARG_ISCSI -LIBVIRT_ARG_WITH([STORAGE_SCSI], [SCSI backend for the storage driver], [check]) +LIBVIRT_STORAGE_ARG_SCSI LIBVIRT_ARG_WITH([STORAGE_MPATH], [mpath backend for the storage driver], [check]) LIBVIRT_ARG_WITH([STORAGE_DISK], [GPartd Disk backend for the storage driver], [check]) LIBVIRT_ARG_WITH([STORAGE_RBD], [RADOS Block Device backend for the storage driver], [check]) @@ -592,16 +592,9 @@ fi LIBVIRT_STORAGE_CHECK_FS LIBVIRT_STORAGE_CHECK_LVM LIBVIRT_STORAGE_CHECK_ISCSI +LIBVIRT_STORAGE_CHECK_SCSI -if test "$with_storage_scsi" = "check" || test "$with_storage_scsi" = "yes"; then - with_storage_scsi=yes - - AC_DEFINE_UNQUOTED([WITH_STORAGE_SCSI], 1, - [whether SCSI backend for storage driver is enabled]) -fi -AM_CONDITIONAL([WITH_STORAGE_SCSI], [test "$with_storage_scsi" = "yes"]) - if test "$with_storage_mpath" = "check" || test "$with_storage_mpath" = "yes"; then if test "$with_linux" = "yes"; then with_storage_mpath=yes @@ -1064,7 +1057,7 @@ LIBVIRT_STORAGE_RESULT_DIR LIBVIRT_STORAGE_RESULT_FS LIBVIRT_STORAGE_RESULT_LVM LIBVIRT_STORAGE_RESULT_ISCSI -AC_MSG_NOTICE([ SCSI: $with_storage_scsi]) +LIBVIRT_STORAGE_RESULT_SCSI AC_MSG_NOTICE([ mpath: $with_storage_mpath]) AC_MSG_NOTICE([ Disk: $with_storage_disk]) AC_MSG_NOTICE([ RBD: $with_storage_rbd]) diff --git a/m4/virt-storage-scsi.m4 b/m4/virt-storage-scsi.m4 new file mode 100644 index 0000000000..dfaa07e2f7 --- /dev/null +++ b/m4/virt-storage-scsi.m4 @@ -0,0 +1,36 @@ +dnl The storage SCSI check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_STORAGE_ARG_SCSI], [ + LIBVIRT_ARG_WITH([STORAGE_SCSI], [SCSI backend for the storage driver], [check]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_CHECK_SCSI], [ + if test "$with_storage_scsi" = "check" || test "$with_storage_scsi" = "yes"; then + with_storage_scsi=yes + + AC_DEFINE_UNQUOTED([WITH_STORAGE_SCSI], 1, + [whether SCSI backend for storage driver is enabled]) + fi + AM_CONDITIONAL([WITH_STORAGE_SCSI], [test "$with_storage_scsi" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_RESULT_SCSI], [ + LIBVIRT_RESULT([SCSI], [$with_storage_scsi]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:50 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 13 +++---------- m4/virt-storage-scsi.m4 | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 m4/virt-storage-scsi.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 23 ++++----------------- m4/virt-storage-mpath.m4 | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 19 deletions(-) create mode 100644 m4/virt-storage-mpath.m4 diff --git a/configure.ac b/configure.ac index 8952247c97..b5f5785e2f 100644 --- a/configure.ac +++ b/configure.ac @@ -560,7 +560,7 @@ LIBVIRT_STORAGE_ARG_FS LIBVIRT_STORAGE_ARG_LVM LIBVIRT_STORAGE_ARG_ISCSI LIBVIRT_STORAGE_ARG_SCSI -LIBVIRT_ARG_WITH([STORAGE_MPATH], [mpath backend for the storage driver], [check]) +LIBVIRT_STORAGE_ARG_MPATH LIBVIRT_ARG_WITH([STORAGE_DISK], [GPartd Disk backend for the storage driver], [check]) LIBVIRT_ARG_WITH([STORAGE_RBD], [RADOS Block Device backend for the storage driver], [check]) LIBVIRT_ARG_WITH([STORAGE_SHEEPDOG], [with Sheepdog backend for the storage driver], [check]) @@ -593,23 +593,9 @@ LIBVIRT_STORAGE_CHECK_FS LIBVIRT_STORAGE_CHECK_LVM LIBVIRT_STORAGE_CHECK_ISCSI LIBVIRT_STORAGE_CHECK_SCSI +LIBVIRT_STORAGE_CHECK_MPATH -if test "$with_storage_mpath" = "check" || test "$with_storage_mpath" = "yes"; then - if test "$with_linux" = "yes"; then - with_storage_mpath=yes - - AC_DEFINE_UNQUOTED([WITH_STORAGE_MPATH], 1, - [whether mpath backend for storage driver is enabled]) - else - if test "$with_storage_mpath" = "yes"; then - AC_MSG_ERROR([mpath storage is only supported on Linux]) - fi - with_storage_mpath=no - fi -fi -AM_CONDITIONAL([WITH_STORAGE_MPATH], [test "$with_storage_mpath" = "yes"]) - LIBRBD_LIBS= if test "$with_storage_rbd" = "yes" || test "$with_storage_rbd" = "check"; then AC_CHECK_HEADER([rbd/librbd.h], [LIBRBD_FOUND=yes; break;]) @@ -725,8 +711,7 @@ if test "$with_storage_disk" = "yes" || fi AM_CONDITIONAL([WITH_STORAGE_DISK], [test "$with_storage_disk" = "yes"]) -if test "$with_storage_mpath" = "yes" || - test "$with_storage_disk" = "yes"; then +if test "$with_storage_disk" = "yes"; then if test "$with_devmapper" = "no" ; then AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper >= $DEVMAPPER_REQUIRED to compile libvirt]) fi @@ -1058,7 +1043,7 @@ LIBVIRT_STORAGE_RESULT_FS LIBVIRT_STORAGE_RESULT_LVM LIBVIRT_STORAGE_RESULT_ISCSI LIBVIRT_STORAGE_RESULT_SCSI -AC_MSG_NOTICE([ mpath: $with_storage_mpath]) +LIBVIRT_STORAGE_RESULT_MPATH AC_MSG_NOTICE([ Disk: $with_storage_disk]) AC_MSG_NOTICE([ RBD: $with_storage_rbd]) AC_MSG_NOTICE([Sheepdog: $with_storage_sheepdog]) diff --git a/m4/virt-storage-mpath.m4 b/m4/virt-storage-mpath.m4 new file mode 100644 index 0000000000..b20d0860f9 --- /dev/null +++ b/m4/virt-storage-mpath.m4 @@ -0,0 +1,53 @@ +dnl The storage mpath check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_STORAGE_ARG_MPATH], [ + LIBVIRT_ARG_WITH([STORAGE_MPATH], [mpath backend for the storage driver], + [check]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_CHECK_MPATH], [ + AC_REQUIRE([LIBVIRT_CHECK_DEVMAPPER]) + + if test "$with_storage_mpath" = "check" || test "$with_storage_mpath" = "yes"; then + if test "$with_linux" = "yes"; then + with_storage_mpath=yes + + AC_DEFINE_UNQUOTED([WITH_STORAGE_MPATH], 1, + [whether mpath backend for storage driver is enabled]) + else + if test "$with_storage_mpath" = "yes"; then + AC_MSG_ERROR([mpath storage is only supported on Linux]) + fi + with_storage_mpath=no + fi + fi + + if test "x$with_storage_mpath" = "xyes"; then + if test "x$with_devmapper" = "xno"; then + AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper to compile libvirt with mpath storage driver]) + fi + fi + + AM_CONDITIONAL([WITH_STORAGE_MPATH], [test "$with_storage_mpath" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_RESULT_MPATH], [ + LIBVIRT_RESULT([mpath], [$with_storage_mpath]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:51 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 23 ++++----------------- m4/virt-storage-mpath.m4 | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 19 deletions(-) create mode 100644 m4/virt-storage-mpath.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 32 +++------------------------ m4/virt-storage-disk.m4 | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 29 deletions(-) create mode 100644 m4/virt-storage-disk.m4 diff --git a/configure.ac b/configure.ac index b5f5785e2f..0854bc8195 100644 --- a/configure.ac +++ b/configure.ac @@ -561,7 +561,7 @@ LIBVIRT_STORAGE_ARG_LVM LIBVIRT_STORAGE_ARG_ISCSI LIBVIRT_STORAGE_ARG_SCSI LIBVIRT_STORAGE_ARG_MPATH -LIBVIRT_ARG_WITH([STORAGE_DISK], [GPartd Disk backend for the storage driver], [check]) +LIBVIRT_STORAGE_ARG_DISK LIBVIRT_ARG_WITH([STORAGE_RBD], [RADOS Block Device backend for the storage driver], [check]) LIBVIRT_ARG_WITH([STORAGE_SHEEPDOG], [with Sheepdog backend for the storage driver], [check]) LIBVIRT_ARG_WITH([STORAGE_GLUSTER], [Gluster backend for the storage driver], [check]) @@ -689,33 +689,7 @@ if test "$with_storage_fs" = "yes" || fi fi -if test "$with_storage_disk" = "yes" || - test "$with_storage_disk" = "check"; then - if test "$with_storage_disk" = "yes" && - test "$with_libparted" != "yes"; then - AC_MSG_ERROR([Need parted for disk storage driver]) - fi - - if test "$with_storage_disk" = "check"; then - if test "$with_libparted" != "yes"; then - with_storage_disk=no - else - with_storage_disk=yes - fi - fi - - if test "$with_storage_disk" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_STORAGE_DISK], 1, - [whether Disk backend for storage driver is enabled]) - fi -fi -AM_CONDITIONAL([WITH_STORAGE_DISK], [test "$with_storage_disk" = "yes"]) - -if test "$with_storage_disk" = "yes"; then - if test "$with_devmapper" = "no" ; then - AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper >= $DEVMAPPER_REQUIRED to compile libvirt]) - fi -fi +LIBVIRT_STORAGE_CHECK_DISK with_storage=no for backend in dir fs lvm iscsi scsi mpath rbd disk; do @@ -1044,7 +1018,7 @@ LIBVIRT_STORAGE_RESULT_LVM LIBVIRT_STORAGE_RESULT_ISCSI LIBVIRT_STORAGE_RESULT_SCSI LIBVIRT_STORAGE_RESULT_MPATH -AC_MSG_NOTICE([ Disk: $with_storage_disk]) +LIBVIRT_STORAGE_RESULT_DISK AC_MSG_NOTICE([ RBD: $with_storage_rbd]) AC_MSG_NOTICE([Sheepdog: $with_storage_sheepdog]) AC_MSG_NOTICE([ Gluster: $with_storage_gluster]) diff --git a/m4/virt-storage-disk.m4 b/m4/virt-storage-disk.m4 new file mode 100644 index 0000000000..3c4c848ccd --- /dev/null +++ b/m4/virt-storage-disk.m4 @@ -0,0 +1,58 @@ +dnl The storage disk check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_STORAGE_ARG_DISK], [ + LIBVIRT_ARG_WITH([STORAGE_DISK], [GPartd Disk backend for the storage driver], + [check]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_CHECK_DISK], [ + AC_REQUIRE([LIBVIRT_CHECK_DEVMAPPER]) + AC_REQUIRE([LIBVIRT_CHECK_LIBPARTED]) + + if test "$with_storage_disk" = "yes" || + test "$with_storage_disk" = "check"; then + + if test "$with_storage_disk" = "yes" && + test "$with_libparted" != "yes"; then + AC_MSG_ERROR([Need parted for disk storage driver]) + fi + + if test "$with_storage_disk" = "check"; then + with_storage_disk="$with_libparted" + fi + + if test "$with_storage_disk" = "yes"; then + AC_DEFINE_UNQUOTED([WITH_STORAGE_DISK], 1, + [whether Disk backend for storage driver is enabled]) + fi + fi + + if test "x$with_storage_disk" = "xyes"; then + if test "x$with_devmapper" = "xno"; then + AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper to compile libvirt with disk storage driver]) + fi + fi + + AM_CONDITIONAL([WITH_STORAGE_DISK], [test "$with_storage_disk" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_RESULT_DISK], [ + LIBVIRT_RESULT([Disk], [$with_storage_disk]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:52 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 32 +++------------------------ m4/virt-storage-disk.m4 | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 29 deletions(-) create mode 100644 m4/virt-storage-disk.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 28 ++++------------------------ m4/virt-storage-rbd.m4 | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 24 deletions(-) create mode 100644 m4/virt-storage-rbd.m4 diff --git a/configure.ac b/configure.ac index 0854bc8195..70e281d1dd 100644 --- a/configure.ac +++ b/configure.ac @@ -562,7 +562,7 @@ LIBVIRT_STORAGE_ARG_ISCSI LIBVIRT_STORAGE_ARG_SCSI LIBVIRT_STORAGE_ARG_MPATH LIBVIRT_STORAGE_ARG_DISK -LIBVIRT_ARG_WITH([STORAGE_RBD], [RADOS Block Device backend for the storage driver], [check]) +LIBVIRT_STORAGE_ARG_RBD LIBVIRT_ARG_WITH([STORAGE_SHEEPDOG], [with Sheepdog backend for the storage driver], [check]) LIBVIRT_ARG_WITH([STORAGE_GLUSTER], [Gluster backend for the storage driver], [check]) LIBVIRT_ARG_WITH([STORAGE_ZFS], [ZFS backend for the storage driver], [check]) @@ -594,24 +594,9 @@ LIBVIRT_STORAGE_CHECK_LVM LIBVIRT_STORAGE_CHECK_ISCSI LIBVIRT_STORAGE_CHECK_SCSI LIBVIRT_STORAGE_CHECK_MPATH +LIBVIRT_STORAGE_CHECK_RBD -LIBRBD_LIBS= -if test "$with_storage_rbd" = "yes" || test "$with_storage_rbd" = "check"; then - AC_CHECK_HEADER([rbd/librbd.h], [LIBRBD_FOUND=yes; break;]) - - if test "$LIBRBD_FOUND" = "yes"; then - with_storage_rbd=yes - LIBRBD_LIBS="-lrbd -lrados" - AC_DEFINE_UNQUOTED([WITH_STORAGE_RBD], [1], - [whether RBD backend for storage driver is enabled]) - else - with_storage_rbd=no - fi -fi -AM_CONDITIONAL([WITH_STORAGE_RBD], [test "$with_storage_rbd" = "yes"]) -AC_SUBST([LIBRBD_LIBS]) - if test "$with_storage_sheepdog" = "yes" || test "$with_storage_sheepdog" = "check"; then AC_PATH_PROGS([SHEEPDOGCLI], [collie dog], [], [$LIBVIRT_SBIN_PATH]) @@ -1019,7 +1004,7 @@ LIBVIRT_STORAGE_RESULT_ISCSI LIBVIRT_STORAGE_RESULT_SCSI LIBVIRT_STORAGE_RESULT_MPATH LIBVIRT_STORAGE_RESULT_DISK -AC_MSG_NOTICE([ RBD: $with_storage_rbd]) +LIBVIRT_STORAGE_RESULT_RBD AC_MSG_NOTICE([Sheepdog: $with_storage_sheepdog]) AC_MSG_NOTICE([ Gluster: $with_storage_gluster]) AC_MSG_NOTICE([ ZFS: $with_storage_zfs]) @@ -1062,6 +1047,7 @@ LIBVIRT_RESULT_OPENWSMAN LIBVIRT_RESULT_PCIACCESS LIBVIRT_RESULT_PM_UTILS LIBVIRT_RESULT_POLKIT +LIBVIRT_RESULT_RBD LIBVIRT_RESULT_READLINE LIBVIRT_RESULT_SANLOCK LIBVIRT_RESULT_SASL @@ -1073,12 +1059,6 @@ LIBVIRT_RESULT_XDR LIBVIRT_RESULT_XEN LIBVIRT_RESULT_XENAPI LIBVIRT_RESULT_YAJL -if test "$with_storage_rbd" = "yes" ; then -AC_MSG_NOTICE([ rbd: $LIBRBD_LIBS]) -else -AC_MSG_NOTICE([ rbd: no]) -fi - AC_MSG_NOTICE([]) AC_MSG_NOTICE([Windows]) AC_MSG_NOTICE([]) diff --git a/m4/virt-storage-rbd.m4 b/m4/virt-storage-rbd.m4 new file mode 100644 index 0000000000..6569bb4d32 --- /dev/null +++ b/m4/virt-storage-rbd.m4 @@ -0,0 +1,49 @@ +dnl The storage RBD check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_STORAGE_ARG_RBD], [ + LIBVIRT_ARG_WITH([STORAGE_RBD], + [RADOS Block Device backend for the storage driver], [check]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_CHECK_RBD], [ + LIBRBD_LIBS= + if test "$with_storage_rbd" = "yes" || test "$with_storage_rbd" = "check"; then + AC_CHECK_HEADER([rbd/librbd.h], [LIBRBD_FOUND=yes; break;]) + + if test "$LIBRBD_FOUND" = "yes"; then + with_storage_rbd=yes + LIBRBD_LIBS="-lrbd -lrados" + AC_DEFINE_UNQUOTED([WITH_STORAGE_RBD], [1], + [whether RBD backend for storage driver is enabled]) + else + with_storage_rbd=no + fi + fi + AM_CONDITIONAL([WITH_STORAGE_RBD], [test "$with_storage_rbd" = "yes"]) + AC_SUBST([LIBRBD_LIBS]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_RESULT_RBD], [ + LIBVIRT_RESULT([RBD], [$with_storage_dir]) +]) + +AC_DEFUN([LIBVIRT_RESULT_RBD], [ + LIBVIRT_RESULT([rbd], [$with_storage_rbd], [CFLAGS='' LIBS='$LIBRBD_LIBS']) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:53 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 28 ++++------------------------ m4/virt-storage-rbd.m4 | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 24 deletions(-) create mode 100644 m4/virt-storage-rbd.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 32 +++----------------------- m4/virt-storage-sheepdog.m4 | 56 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 29 deletions(-) create mode 100644 m4/virt-storage-sheepdog.m4 diff --git a/configure.ac b/configure.ac index 70e281d1dd..05895fd2a4 100644 --- a/configure.ac +++ b/configure.ac @@ -563,7 +563,7 @@ LIBVIRT_STORAGE_ARG_SCSI LIBVIRT_STORAGE_ARG_MPATH LIBVIRT_STORAGE_ARG_DISK LIBVIRT_STORAGE_ARG_RBD -LIBVIRT_ARG_WITH([STORAGE_SHEEPDOG], [with Sheepdog backend for the storage driver], [check]) +LIBVIRT_STORAGE_ARG_SHEEPDOG LIBVIRT_ARG_WITH([STORAGE_GLUSTER], [Gluster backend for the storage driver], [check]) LIBVIRT_ARG_WITH([STORAGE_ZFS], [ZFS backend for the storage driver], [check]) @@ -595,35 +595,9 @@ LIBVIRT_STORAGE_CHECK_ISCSI LIBVIRT_STORAGE_CHECK_SCSI LIBVIRT_STORAGE_CHECK_MPATH LIBVIRT_STORAGE_CHECK_RBD +LIBVIRT_STORAGE_CHECK_SHEEPDOG -if test "$with_storage_sheepdog" = "yes" || - test "$with_storage_sheepdog" = "check"; then - AC_PATH_PROGS([SHEEPDOGCLI], [collie dog], [], [$LIBVIRT_SBIN_PATH]) - - if test "$with_storage_sheepdog" = "yes"; then - if test -z "$SHEEPDOGCLI"; then - AC_MSG_ERROR([We need sheepdog client for Sheepdog storage driver]) - fi - else - if test -z "$SHEEPDOGCLI"; then - with_storage_sheepdog=no - fi - - if test "$with_storage_sheepdog" = "check"; then - with_storage_sheepdog=yes - fi - fi - - if test "$with_storage_sheepdog" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_STORAGE_SHEEPDOG], 1, - [whether Sheepdog backend for storage driver is enabled]) - AC_DEFINE_UNQUOTED([SHEEPDOGCLI],["$SHEEPDOGCLI"],[Location of sheepdog client program]) - fi -fi -AM_CONDITIONAL([WITH_STORAGE_SHEEPDOG], - [test "$with_storage_sheepdog" = "yes"]) - if test "$with_storage_gluster" = "check"; then with_storage_gluster=$with_glusterfs fi @@ -1005,7 +979,7 @@ LIBVIRT_STORAGE_RESULT_SCSI LIBVIRT_STORAGE_RESULT_MPATH LIBVIRT_STORAGE_RESULT_DISK LIBVIRT_STORAGE_RESULT_RBD -AC_MSG_NOTICE([Sheepdog: $with_storage_sheepdog]) +LIBVIRT_STORAGE_RESULT_SHEEPDOG AC_MSG_NOTICE([ Gluster: $with_storage_gluster]) AC_MSG_NOTICE([ ZFS: $with_storage_zfs]) AC_MSG_NOTICE([]) diff --git a/m4/virt-storage-sheepdog.m4 b/m4/virt-storage-sheepdog.m4 new file mode 100644 index 0000000000..a9f4c834dd --- /dev/null +++ b/m4/virt-storage-sheepdog.m4 @@ -0,0 +1,56 @@ +dnl The storage Sheepdog check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_STORAGE_ARG_SHEEPDOG], [ + LIBVIRT_ARG_WITH([STORAGE_SHEEPDOG], + [with Sheepdog backend for the storage driver], [check]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_CHECK_SHEEPDOG], [ + if test "$with_storage_sheepdog" = "yes" || + test "$with_storage_sheepdog" = "check"; then + AC_PATH_PROGS([SHEEPDOGCLI], [collie dog], [], [$LIBVIRT_SBIN_PATH]) + + if test "$with_storage_sheepdog" = "yes"; then + if test -z "$SHEEPDOGCLI"; then + AC_MSG_ERROR([We need sheepdog client for Sheepdog storage driver]) + fi + else + if test -z "$SHEEPDOGCLI"; then + with_storage_sheepdog=no + fi + + if test "$with_storage_sheepdog" = "check"; then + with_storage_sheepdog=yes + fi + fi + + if test "$with_storage_sheepdog" = "yes"; then + AC_DEFINE_UNQUOTED([WITH_STORAGE_SHEEPDOG], 1, + [whether Sheepdog backend for storage driver is enabled]) + AC_DEFINE_UNQUOTED([SHEEPDOGCLI], ["$SHEEPDOGCLI"], + [Location of sheepdog client program]) + fi + fi + AM_CONDITIONAL([WITH_STORAGE_SHEEPDOG], [test "$with_storage_sheepdog" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_RESULT_SHEEPDOG], [ + LIBVIRT_RESULT([Sheepdog], [$with_storage_sheepdog]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:54 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 32 +++----------------------- m4/virt-storage-sheepdog.m4 | 56 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 29 deletions(-) create mode 100644 m4/virt-storage-sheepdog.m4 ... diff --git a/m4/virt-storage-sheepdog.m4 b/m4/virt-storage-sheepdog.m4 new file mode 100644 index 0000000000..a9f4c834dd --- /dev/null +++ b/m4/virt-storage-sheepdog.m4 @@ -0,0 +1,56 @@ ... +AC_DEFUN([LIBVIRT_STORAGE_CHECK_SHEEPDOG], [ + if test "$with_storage_sheepdog" = "yes" || + test "$with_storage_sheepdog" = "check"; then + AC_PATH_PROGS([SHEEPDOGCLI], [collie dog], [], [$LIBVIRT_SBIN_PATH]) + + if test "$with_storage_sheepdog" = "yes"; then + if test -z "$SHEEPDOGCLI"; then + AC_MSG_ERROR([We need sheepdog client for Sheepdog storage driver]) + fi + else + if test -z "$SHEEPDOGCLI"; then + with_storage_sheepdog=no + fi + + if test "$with_storage_sheepdog" = "check"; then
This is always true; not your fault, though. ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 17 +++-------------- m4/virt-storage-gluster.m4 | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 14 deletions(-) create mode 100644 m4/virt-storage-gluster.m4 diff --git a/configure.ac b/configure.ac index 05895fd2a4..914ace9139 100644 --- a/configure.ac +++ b/configure.ac @@ -564,7 +564,7 @@ LIBVIRT_STORAGE_ARG_MPATH LIBVIRT_STORAGE_ARG_DISK LIBVIRT_STORAGE_ARG_RBD LIBVIRT_STORAGE_ARG_SHEEPDOG -LIBVIRT_ARG_WITH([STORAGE_GLUSTER], [Gluster backend for the storage driver], [check]) +LIBVIRT_STORAGE_ARG_GLUSTER LIBVIRT_ARG_WITH([STORAGE_ZFS], [ZFS backend for the storage driver], [check]) if test "$with_libvirtd" = "no"; then @@ -596,20 +596,9 @@ LIBVIRT_STORAGE_CHECK_SCSI LIBVIRT_STORAGE_CHECK_MPATH LIBVIRT_STORAGE_CHECK_RBD LIBVIRT_STORAGE_CHECK_SHEEPDOG +LIBVIRT_STORAGE_CHECK_GLUSTER -if test "$with_storage_gluster" = "check"; then - with_storage_gluster=$with_glusterfs -fi -if test "$with_storage_gluster" = "yes"; then - if test "$with_glusterfs" = no; then - AC_MSG_ERROR([Need glusterfs (libgfapi) for gluster storage driver]) - fi - AC_DEFINE_UNQUOTED([WITH_STORAGE_GLUSTER], [1], - [whether Gluster backend for storage driver is enabled]) -fi -AM_CONDITIONAL([WITH_STORAGE_GLUSTER], [test "$with_storage_gluster" = "yes"]) - if test "$with_storage_zfs" = "yes" || test "$with_storage_zfs" = "check"; then AC_PATH_PROG([ZFS], [zfs], [], [$LIBVIRT_SBIN_PATH]) @@ -980,7 +969,7 @@ LIBVIRT_STORAGE_RESULT_MPATH LIBVIRT_STORAGE_RESULT_DISK LIBVIRT_STORAGE_RESULT_RBD LIBVIRT_STORAGE_RESULT_SHEEPDOG -AC_MSG_NOTICE([ Gluster: $with_storage_gluster]) +LIBVIRT_STORAGE_RESULT_GLUSTER AC_MSG_NOTICE([ ZFS: $with_storage_zfs]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Security Drivers]) diff --git a/m4/virt-storage-gluster.m4 b/m4/virt-storage-gluster.m4 new file mode 100644 index 0000000000..06272991f4 --- /dev/null +++ b/m4/virt-storage-gluster.m4 @@ -0,0 +1,43 @@ +dnl The storage Gluster check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_STORAGE_ARG_GLUSTER], [ + LIBVIRT_ARG_WITH([STORAGE_GLUSTER], [Gluster backend for the storage driver], + [check]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_CHECK_GLUSTER], [ + AC_REQUIRE([LIBVIRT_CHECK_GLUSTER]) + + if test "$with_storage_gluster" = "check"; then + with_storage_gluster=$with_glusterfs + fi + if test "$with_storage_gluster" = "yes"; then + if test "$with_glusterfs" = no; then + AC_MSG_ERROR([Need glusterfs (libgfapi) for gluster storage driver]) + fi + AC_DEFINE_UNQUOTED([WITH_STORAGE_GLUSTER], [1], + [whether Gluster backend for storage driver is enabled]) + fi + AM_CONDITIONAL([WITH_STORAGE_GLUSTER], [test "$with_storage_gluster" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_RESULT_GLUSTER], [ + LIBVIRT_RESULT([Gluster], [$with_storage_gluster]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:55 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 17 +++-------------- m4/virt-storage-gluster.m4 | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 14 deletions(-) create mode 100644 m4/virt-storage-gluster.m4
ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 34 +++--------------------------- m4/virt-storage-zfs.m4 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 31 deletions(-) create mode 100644 m4/virt-storage-zfs.m4 diff --git a/configure.ac b/configure.ac index 914ace9139..fc88593755 100644 --- a/configure.ac +++ b/configure.ac @@ -565,7 +565,7 @@ LIBVIRT_STORAGE_ARG_DISK LIBVIRT_STORAGE_ARG_RBD LIBVIRT_STORAGE_ARG_SHEEPDOG LIBVIRT_STORAGE_ARG_GLUSTER -LIBVIRT_ARG_WITH([STORAGE_ZFS], [ZFS backend for the storage driver], [check]) +LIBVIRT_STORAGE_ARG_ZFS if test "$with_libvirtd" = "no"; then with_storage_dir=no @@ -597,37 +597,9 @@ LIBVIRT_STORAGE_CHECK_MPATH LIBVIRT_STORAGE_CHECK_RBD LIBVIRT_STORAGE_CHECK_SHEEPDOG LIBVIRT_STORAGE_CHECK_GLUSTER +LIBVIRT_STORAGE_CHECK_ZFS -if test "$with_storage_zfs" = "yes" || - test "$with_storage_zfs" = "check"; then - AC_PATH_PROG([ZFS], [zfs], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([ZPOOL], [zpool], [], [$LIBVIRT_SBIN_PATH]) - - if test "$with_storage_zfs" = "yes"; then - if test -z "$ZFS" || test -z "$ZPOOL"; then - AC_MSG_ERROR([We need zfs and zpool for ZFS storage driver]) - fi - else - if test -z "$ZFS" || test -z "$ZPOOL"; then - with_storage_zfs=no - fi - - if test "$with_storage_zfs" = "check"; then - with_storage_zfs=yes - fi - fi - - if test "$with_storage_zfs" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_STORAGE_ZFS], 1, - [whether ZFS backend for storage driver is enabled]) - AC_DEFINE_UNQUOTED([ZFS], ["$ZFS"], [Location of zfs program]) - AC_DEFINE_UNQUOTED([ZPOOL], ["$ZPOOL"], [Location of zpool program]) - fi -fi -AM_CONDITIONAL([WITH_STORAGE_ZFS], - [test "$with_storage_zfs" = "yes"]) - if test "$with_storage_fs" = "yes" || test "$with_storage_gluster" = "yes"; then AC_PATH_PROG([GLUSTER_CLI], [gluster], [], [$LIBVIRT_SBIN_PATH]) @@ -970,7 +942,7 @@ LIBVIRT_STORAGE_RESULT_DISK LIBVIRT_STORAGE_RESULT_RBD LIBVIRT_STORAGE_RESULT_SHEEPDOG LIBVIRT_STORAGE_RESULT_GLUSTER -AC_MSG_NOTICE([ ZFS: $with_storage_zfs]) +LIBVIRT_STORAGE_RESULT_ZFS AC_MSG_NOTICE([]) AC_MSG_NOTICE([Security Drivers]) AC_MSG_NOTICE([]) diff --git a/m4/virt-storage-zfs.m4 b/m4/virt-storage-zfs.m4 new file mode 100644 index 0000000000..5439b8b0d4 --- /dev/null +++ b/m4/virt-storage-zfs.m4 @@ -0,0 +1,56 @@ +dnl The storage ZFS check +dnl +dnl Copyright (C) 2016 Red Hat, Inc. +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/>. +dnl + +AC_DEFUN([LIBVIRT_STORAGE_ARG_ZFS], [ + LIBVIRT_ARG_WITH([STORAGE_ZFS], [ZFS backend for the storage driver], [check]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_CHECK_ZFS], [ + if test "$with_storage_zfs" = "yes" || + test "$with_storage_zfs" = "check"; then + AC_PATH_PROG([ZFS], [zfs], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([ZPOOL], [zpool], [], [$LIBVIRT_SBIN_PATH]) + + if test "$with_storage_zfs" = "yes"; then + if test -z "$ZFS" || test -z "$ZPOOL"; then + AC_MSG_ERROR([We need zfs and zpool for ZFS storage driver]) + fi + else + if test -z "$ZFS" || test -z "$ZPOOL"; then + with_storage_zfs=no + fi + + if test "$with_storage_zfs" = "check"; then + with_storage_zfs=yes + fi + fi + + if test "$with_storage_zfs" = "yes"; then + AC_DEFINE_UNQUOTED([WITH_STORAGE_ZFS], 1, + [whether ZFS backend for storage driver is enabled]) + AC_DEFINE_UNQUOTED([ZFS], ["$ZFS"], [Location of zfs program]) + AC_DEFINE_UNQUOTED([ZPOOL], ["$ZPOOL"], [Location of zpool program]) + fi + fi + AM_CONDITIONAL([WITH_STORAGE_ZFS], [test "$with_storage_zfs" = "yes"]) +]) + +AC_DEFUN([LIBVIRT_STORAGE_RESULT_ZFS], [ + LIBVIRT_RESULT([ZFS], [$with_storage_zfs]) +]) -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:56 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 34 +++--------------------------- m4/virt-storage-zfs.m4 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 31 deletions(-) create mode 100644 m4/virt-storage-zfs.m4 ... diff --git a/m4/virt-storage-zfs.m4 b/m4/virt-storage-zfs.m4 new file mode 100644 index 0000000000..5439b8b0d4 --- /dev/null +++ b/m4/virt-storage-zfs.m4 @@ -0,0 +1,56 @@ ... +AC_DEFUN([LIBVIRT_STORAGE_CHECK_ZFS], [ + if test "$with_storage_zfs" = "yes" || + test "$with_storage_zfs" = "check"; then + AC_PATH_PROG([ZFS], [zfs], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([ZPOOL], [zpool], [], [$LIBVIRT_SBIN_PATH]) + + if test "$with_storage_zfs" = "yes"; then + if test -z "$ZFS" || test -z "$ZPOOL"; then + AC_MSG_ERROR([We need zfs and zpool for ZFS storage driver]) + fi + else + if test -z "$ZFS" || test -z "$ZPOOL"; then + with_storage_zfs=no + fi + + if test "$with_storage_zfs" = "check"; then
Useless check again. ACK Jirka

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index fc88593755..8e80e8b52d 100644 --- a/configure.ac +++ b/configure.ac @@ -555,6 +555,10 @@ fi AM_CONDITIONAL([WITH_SECRETS], [test "$with_secrets" = "yes"]) +dnl +dnl Storage driver checks +dnl + LIBVIRT_STORAGE_ARG_DIR LIBVIRT_STORAGE_ARG_FS LIBVIRT_STORAGE_ARG_LVM @@ -581,25 +585,24 @@ if test "$with_libvirtd" = "no"; then with_storage_zfs=no fi -LIBVIRT_STORAGE_CHECK_DIR - dnl storage-fs does not work on MacOS X if test "$with_osx" = "yes"; then with_storage_fs=no fi +LIBVIRT_STORAGE_CHECK_DIR LIBVIRT_STORAGE_CHECK_FS LIBVIRT_STORAGE_CHECK_LVM LIBVIRT_STORAGE_CHECK_ISCSI LIBVIRT_STORAGE_CHECK_SCSI LIBVIRT_STORAGE_CHECK_MPATH +LIBVIRT_STORAGE_CHECK_DISK LIBVIRT_STORAGE_CHECK_RBD LIBVIRT_STORAGE_CHECK_SHEEPDOG LIBVIRT_STORAGE_CHECK_GLUSTER LIBVIRT_STORAGE_CHECK_ZFS - if test "$with_storage_fs" = "yes" || test "$with_storage_gluster" = "yes"; then AC_PATH_PROG([GLUSTER_CLI], [gluster], [], [$LIBVIRT_SBIN_PATH]) @@ -609,8 +612,6 @@ if test "$with_storage_fs" = "yes" || fi fi -LIBVIRT_STORAGE_CHECK_DISK - with_storage=no for backend in dir fs lvm iscsi scsi mpath rbd disk; do if eval test \$with_storage_$backend = yes; then -- 2.11.0

On Fri, Dec 16, 2016 at 10:11:57 +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
ACK Jirka

On Fri, Dec 16, 2016 at 10:10:28 +0100, Pavel Hrdina wrote:
Few bug fixes found along the way. Introduces new macro helpers to unify the configure.ac and m4 files. Moves libraries and drivers checks to its own files to clean the configure.ac.
A link to a git repository with all the patches applied would be nice. Especially once you eventually make some changes according to the review. BTW, even though I may not ack all the patches I don't want to see a v2 of this series. Please, just sent a diff to be squashed into each patch which will need to be changed as a reply to that patch. Jirka

On Fri, Dec 16, 2016 at 09:28:12PM +0100, Jiri Denemark wrote:
On Fri, Dec 16, 2016 at 10:10:28 +0100, Pavel Hrdina wrote:
Few bug fixes found along the way. Introduces new macro helpers to unify the configure.ac and m4 files. Moves libraries and drivers checks to its own files to clean the configure.ac.
A link to a git repository with all the patches applied would be nice. Especially once you eventually make some changes according to the review.
I'll keep it in my mind :) Thanks for the review, I'll push it shortly. Pavel
participants (2)
-
Jiri Denemark
-
Pavel Hrdina