1 dnl Process this file with autoconf to produce a configure script.
3 dnl Copyright (C) 2005-2015 Red Hat, Inc.
5 dnl This library is free software; you can redistribute it and/or
6 dnl modify it under the terms of the GNU Lesser General Public
7 dnl License as published by the Free Software Foundation; either
8 dnl version 2.1 of the License, or (at your option) any later version.
10 dnl This library is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 dnl Lesser General Public License for more details.
15 dnl You should have received a copy of the GNU Lesser General Public
16 dnl License along with this library. If not, see
17 dnl <http://www.gnu.org/licenses/>.
19 AC_INIT([libvirt], [5.4.0], [libvir-list@redhat.com], [], [https://libvirt.org])
20 AC_CONFIG_SRCDIR([src/libvirt.c])
21 AC_CONFIG_AUX_DIR([build-aux])
22 AC_CONFIG_HEADERS([config.h])
23 AH_BOTTOM([#include <config-post.h>])
24 AC_CONFIG_MACRO_DIR([m4])
25 dnl Make automake keep quiet about wildcards & other GNUmake-isms
34 dnl older automake's default of ARFLAGS=cru is noisy on newer binutils;
35 dnl we don't really need the 'u' even in older toolchains. Then there is
36 dnl older libtool, which spelled it AR_FLAGS
37 m4_divert_text([DEFAULTS], [: "${ARFLAGS=cr} ${AR_FLAGS=cr}"])
39 # Maintainer note - comment this line out if you plan to rerun
40 # GNULIB_POSIXCHECK testing to see if libvirt should be using more modules.
41 # Leave it uncommented for normal releases, for faster ./configure.
42 gl_ASSERT_NO_GNULIB_POSIXCHECK
44 # Default to using the silent-rules feature when possible. Formatting
45 # chosen to bypass 'grep' checks that cause older automake to warn.
46 # Users (include rpm) can still change the default at configure time.
47 m4_ifndef([AM_SILENT_RULES],
48 [m4_define([AM_SILENT_RULES],[])])AM_SILENT_RULES([yes])
52 # First extract pieces from the version number string
53 LIBVIRT_MAJOR_VERSION=`echo $VERSION | awk -F. '{print $1}'`
54 LIBVIRT_MINOR_VERSION=`echo $VERSION | awk -F. '{print $2}'`
55 LIBVIRT_MICRO_VERSION=`echo $VERSION | awk -F. '{print $3}'`
56 LIBVIRT_VERSION=$LIBVIRT_MAJOR_VERSION.$LIBVIRT_MINOR_VERSION.$LIBVIRT_MICRO_VERSION$LIBVIRT_MICRO_VERSION_SUFFIX
57 LIBVIRT_VERSION_NUMBER=`expr $LIBVIRT_MAJOR_VERSION \* 1000000 + $LIBVIRT_MINOR_VERSION \* 1000 + $LIBVIRT_MICRO_VERSION`
59 # In libtool terminology we need to figure out:
62 # The most recent interface number that this library implements.
65 # The implementation number of the CURRENT interface.
68 # The difference between the newest and oldest interfaces that this
71 # In other words, the library implements all the interface numbers
72 # in the range from number `CURRENT - AGE' to `CURRENT'.
74 # Libtool assigns the soname version from `CURRENT - AGE', and we
75 # don't want that to ever change in libvirt. ie it must always be
76 # zero, to produce libvirt.so.0.
78 # We would, however, like the libvirt version number reflected
79 # in the so version'd symlinks, and this is based on AGE.REVISION
80 # eg libvirt.so.0.AGE.REVISION
82 # Assuming we do ever want to break soname version, this can
83 # toggled. But seriously, don't ever touch this.
86 # The following examples show what libtool will do
88 # Input: 0.9.14 -> libvirt.so.0.9.14
89 # Input: 1.0.0 -> libvirt.so.0.1000.0
90 # Input: 2.5.8 -> libvirt.so.0.2005.8
92 AGE=`expr $LIBVIRT_MAJOR_VERSION '*' 1000 + $LIBVIRT_MINOR_VERSION`
93 REVISION=$LIBVIRT_MICRO_VERSION
94 CURRENT=`expr $LIBVIRT_SONUM + $AGE`
95 LIBVIRT_VERSION_INFO=$CURRENT:$REVISION:$AGE
97 AC_SUBST([LIBVIRT_MAJOR_VERSION])
98 AC_SUBST([LIBVIRT_MINOR_VERSION])
99 AC_SUBST([LIBVIRT_MICRO_VERSION])
100 AC_SUBST([LIBVIRT_SONUM])
101 AC_SUBST([LIBVIRT_VERSION])
102 AC_SUBST([LIBVIRT_VERSION_INFO])
103 AC_SUBST([LIBVIRT_VERSION_NUMBER])
105 LIBVIRT_ARG_WITH([PACKAGER], [Extra packager name], [no])
106 LIBVIRT_ARG_WITH([PACKAGER_VERSION], [Extra packager version], [no])
107 if test "x$with_packager" != "xno"
109 AC_DEFINE_UNQUOTED([PACKAGER], ["$with_packager"],
110 [Extra package name])
112 if test "x$with_packager_version" != "xno"
114 AC_DEFINE_UNQUOTED([PACKAGER_VERSION], ["$with_packager_version"],
115 [Extra package version])
118 dnl Where we look for daemons and admin binaries during configure
119 LIBVIRT_SBIN_PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin"
121 dnl Checks for C compiler.
126 dnl Setting AB_VERSION makes the 'autobuild' lines of configure output
127 dnl slightly more useful
128 if test -d $srcdir/.git && git --version >/dev/null 2>&1 ; then
129 AB_VERSION=`cd $srcdir && git describe --match 'v[[0-9]]*' 2>/dev/null`
137 dnl Support building Win32 DLLs (must appear *before* AM_PROG_LIBTOOL)
142 m4_ifndef([LT_INIT], [
145 LT_INIT([shared disable-static])
150 AC_MSG_CHECKING([for how to mark DSO non-deletable at runtime])
152 `$LD --help 2>&1 | grep -- "-z nodelete" >/dev/null` && \
153 LIBVIRT_NODELETE="-Wl,-z -Wl,nodelete"
154 AC_MSG_RESULT([$LIBVIRT_NODELETE])
155 AC_SUBST([LIBVIRT_NODELETE])
157 AC_MSG_CHECKING([for how to set DSO symbol versions])
159 *-*-mingw* | *-*-msvc* )
160 # mingw's ld has the --version-script parameter, but it requires a .def file
161 # instead to work properly, therefore clear --version-script here and use
162 # -Wl, to pass the .def file to the linker
163 # cygwin's ld has the --version-script parameter too, but for some reason
164 # it's working there as expected
165 VERSION_SCRIPT_FLAGS="-Wl,"
168 VERSION_SCRIPT_FLAGS=-Wl,--version-script=
169 `$LD --help 2>&1 | grep -- --version-script >/dev/null` || \
170 VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
173 AC_MSG_RESULT([$VERSION_SCRIPT_FLAGS])
174 AC_SUBST([VERSION_SCRIPT_FLAGS])
176 dnl Specify if we rely on ifconfig instead of iproute2 (e.g. in case
177 dnl we're working on BSD)
180 dnl Make some notes about which OS we're compiling for, as the lxc and qemu
181 dnl drivers require linux headers, and storage_mpath, dtrace, and nwfilter
182 dnl are also linux specific. The "network" and storage_fs drivers are known
183 dnl to not work on macOS presently, so we also make a note if compiling
186 with_linux=no with_macos=no with_freebsd=no with_win=no with_cygwin=no
188 *-*-linux*) with_linux=yes ;;
189 *-*-darwin*) with_macos=yes ;;
190 *-*-freebsd*) with_freebsd=yes ;;
191 *-*-mingw* | *-*-msvc* ) with_win=yes ;;
192 *-*-cygwin*) with_cygwin=yes ;;
195 if test $with_linux = no; then
196 if test "x$with_lxc" != xyes
204 if test $with_freebsd = yes; then
209 if test $with_cygwin = yes; then
213 AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
214 AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"])
216 # We don't support the daemon yet
217 if test "$with_win" = "yes" ; then
221 # The daemon requires remote support. Likewise, if we are not using
222 # RPC, we don't need several libraries.
223 if test "$with_remote" = "no" ; then
229 # Stateful drivers are useful only when building the daemon.
230 if test "$with_libvirtd" = "no" ; then
237 # Check for compiler and library settings.
239 LIBVIRT_COMPILE_WARNINGS
242 LIBVIRT_LINKER_NO_INDIRECT
243 LIBVIRT_LINKER_NO_UNDEFINED
249 LIBVIRT_ARG_BASH_COMPLETION
254 LIBVIRT_ARG_FIREWALLD
255 LIBVIRT_ARG_FIREWALLD_ZONE
268 LIBVIRT_ARG_OPENWSMAN
269 LIBVIRT_ARG_PCIACCESS
278 LIBVIRT_ARG_VIRTUALPORT
279 LIBVIRT_ARG_WIRESHARK
283 LIBVIRT_CHECK_APPARMOR
288 LIBVIRT_CHECK_BASH_COMPLETION
293 LIBVIRT_CHECK_DEVMAPPER
295 LIBVIRT_CHECK_FIREWALLD
296 LIBVIRT_CHECK_FIREWALLD_ZONE
298 LIBVIRT_CHECK_GLUSTER
301 LIBVIRT_CHECK_LIBISCSI
303 LIBVIRT_CHECK_LIBPARTED
304 LIBVIRT_CHECK_LIBPCAP
307 LIBVIRT_CHECK_MACVTAP
310 LIBVIRT_CHECK_NUMACTL
311 LIBVIRT_CHECK_NWFILTER
312 LIBVIRT_CHECK_OPENWSMAN
313 LIBVIRT_CHECK_PCIACCESS
314 LIBVIRT_CHECK_PM_UTILS
316 LIBVIRT_CHECK_PTHREAD
317 LIBVIRT_CHECK_READLINE
318 LIBVIRT_CHECK_SANLOCK
320 LIBVIRT_CHECK_SELINUX
323 LIBVIRT_CHECK_VIRTUALPORT
324 LIBVIRT_CHECK_WIRESHARK
328 AC_CHECK_SIZEOF([long])
330 dnl Availability of various common functions (non-fatal if missing),
331 dnl and various less common threadsafe functions
332 AC_CHECK_FUNCS_ONCE([\
358 dnl Availability of various common headers (non-fatal if missing).
375 dnl Check whether endian provides handy macros.
376 AC_CHECK_DECLS([htole64], [], [], [[#include <endian.h>]])
377 AC_CHECK_FUNCS([stat stat64 __xstat __xstat64 lstat lstat64 __lxstat __lxstat64])
379 AC_CHECK_TYPE([struct ifreq],
380 [AC_DEFINE([HAVE_STRUCT_IFREQ],[1],
381 [Defined if struct ifreq exists in net/if.h])],
382 [], [[#include <sys/socket.h>
386 AC_CHECK_TYPE([struct sockpeercred],
387 [AC_DEFINE([HAVE_STRUCT_SOCKPEERCRED], [1],
388 [Defined if struct sockpeercred is available])],
389 [], [[#include <sys/socket.h>
392 AC_CHECK_DECLS([ETH_FLAG_TXVLAN, ETH_FLAG_NTUPLE, ETH_FLAG_RXHASH, ETH_FLAG_LRO,
393 ETHTOOL_GGSO, ETHTOOL_GGRO, ETHTOOL_GFLAGS, ETHTOOL_GFEATURES,
394 ETHTOOL_SCOALESCE, ETHTOOL_GCOALESCE],
395 [], [], [[#include <linux/ethtool.h>
398 AC_CHECK_DECLS([SEEK_HOLE], [], [],
399 [#include <sys/types.h>
400 #include <unistd.h>])
403 dnl Our only use of libtasn1.h is in the testsuite, and can be skipped
404 dnl if the header is not present. Assume -ltasn1 is present if the
405 dnl header could be found.
406 AM_CONDITIONAL([HAVE_LIBTASN1], [test "x$ac_cv_header_libtasn1_h" = "xyes"])
408 AC_CHECK_LIB([intl],[gettext],[])
412 dnl Check for external programs
415 LIBVIRT_CHECK_EXTERNAL_PROGRAMS
417 dnl if --prefix is /usr, don't use /usr/var for localstatedir
418 dnl or /usr/etc for sysconfdir
419 dnl as this makes a lot of things break in testing situations
421 if test "$prefix" = "/usr" && test "$localstatedir" = '${prefix}/var' ; then
424 if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then
429 dnl Virtualization drivers check
432 LIBVIRT_DRIVER_ARG_QEMU
433 LIBVIRT_DRIVER_ARG_OPENVZ
434 LIBVIRT_DRIVER_ARG_VMWARE
435 LIBVIRT_DRIVER_ARG_PHYP
436 LIBVIRT_DRIVER_ARG_XENAPI
437 LIBVIRT_DRIVER_ARG_LIBXL
438 LIBVIRT_DRIVER_ARG_VBOX
439 LIBVIRT_DRIVER_ARG_LXC
440 LIBVIRT_DRIVER_ARG_VZ
441 LIBVIRT_DRIVER_ARG_BHYVE
442 LIBVIRT_DRIVER_ARG_ESX
443 LIBVIRT_DRIVER_ARG_HYPERV
444 LIBVIRT_DRIVER_ARG_TEST
445 LIBVIRT_DRIVER_ARG_REMOTE
446 LIBVIRT_DRIVER_ARG_LIBVIRTD
447 LIBVIRT_DRIVER_ARG_NETWORK
448 LIBVIRT_DRIVER_ARG_INTERFACE
450 LIBVIRT_DRIVER_CHECK_QEMU
451 LIBVIRT_DRIVER_CHECK_OPENVZ
452 LIBVIRT_DRIVER_CHECK_VMWARE
453 LIBVIRT_DRIVER_CHECK_PHYP
454 LIBVIRT_DRIVER_CHECK_XENAPI
455 LIBVIRT_DRIVER_CHECK_LIBXL
456 LIBVIRT_DRIVER_CHECK_VBOX
457 LIBVIRT_DRIVER_CHECK_LXC
458 LIBVIRT_DRIVER_CHECK_VZ
459 LIBVIRT_DRIVER_CHECK_BHYVE
460 LIBVIRT_DRIVER_CHECK_ESX
461 LIBVIRT_DRIVER_CHECK_HYPERV
462 LIBVIRT_DRIVER_CHECK_TEST
463 LIBVIRT_DRIVER_CHECK_REMOTE
464 LIBVIRT_DRIVER_CHECK_LIBVIRTD
465 LIBVIRT_DRIVER_CHECK_NETWORK
466 LIBVIRT_DRIVER_CHECK_INTERFACE
468 AM_CONDITIONAL([WITH_XENCONFIG], [test "$with_libxl" = "yes"])
472 dnl in case someone want to build static binaries
473 dnl STATIC_BINARIES="-static"
476 AC_SUBST([STATIC_BINARIES])
479 dnl Miscellaneous checks
485 LIBVIRT_ARG_INIT_SCRIPT
486 LIBVIRT_ARG_CHRDEV_LOCK_FILES
487 LIBVIRT_ARG_DEFAULT_EDITOR
488 LIBVIRT_ARG_LOADER_NVRAM
489 LIBVIRT_ARG_LOGIN_SHELL
490 LIBVIRT_ARG_HOST_VALIDATE
491 LIBVIRT_ARG_TLS_PRIORITY
492 LIBVIRT_ARG_SYSCTL_CONFIG
498 LIBVIRT_CHECK_INIT_SCRIPT
499 LIBVIRT_CHECK_CHRDEV_LOCK_FILES
500 LIBVIRT_CHECK_DEFAULT_EDITOR
501 LIBVIRT_CHECK_LOADER_NVRAM
502 LIBVIRT_CHECK_LOGIN_SHELL
503 LIBVIRT_CHECK_HOST_VALIDATE
504 LIBVIRT_CHECK_TLS_PRIORITY
505 LIBVIRT_CHECK_SYSCTL_CONFIG
512 dnl check for kvm headers
514 AC_CHECK_HEADERS([linux/kvm.h])
517 AM_CONDITIONAL([WITH_SETUID_RPC_CLIENT], [test "$with_lxc$with_login_shell" != "nono"])
521 dnl check for kernel headers required by src/bridge.c
523 if test "$with_linux" = "yes"; then
524 # Various kernel versions have headers that are not self-standing, but
525 # yet are incompatible with the corresponding glibc headers. In order
526 # to guarantee compilation across a wide range of versions (from RHEL 5
527 # to rawhide), we first have to probe whether glibc and kernel can be
528 # used in tandem; and if not, provide workarounds that ensure that
529 # ABI-compatible IPv6 types are present for use by the kernel headers.
530 # These probes mirror the usage in virnetdevbridge.c
532 [whether <linux/*.h> and <netinet/*.h> headers are compatible],
533 [lv_cv_netinet_linux_compatible],
534 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
535 #include <netinet/in.h>
536 #include <linux/in6.h>
538 [lv_cv_netinet_linux_compatible=yes],
539 [lv_cv_netinet_linux_compatible=no])])
540 if test "x$lv_cv_netinet_linux_compatible" != xyes; then
541 AC_DEFINE([NETINET_LINUX_WORKAROUND], [1],
542 [define to 1 if Linux kernel headers require a workaround to avoid
543 compilation errors when mixed with glibc netinet headers])
545 AC_CHECK_HEADERS([linux/param.h linux/sockios.h linux/if_bridge.h linux/if_tun.h],,
546 [AC_MSG_ERROR([You must install kernel-headers in order to compile libvirt with QEMU or LXC support])],
547 [[#include <netinet/in.h>
548 #if NETINET_LINUX_WORKAROUND
549 # define in6_addr in6_addr_
550 # define sockaddr_in6 sockaddr_in6_
551 # define ipv6_mreq ipv6_mreq_
552 # define in6addr_any in6addr_any_
553 # define in6addr_loopback in6addr_loopback_
555 #include <linux/in6.h>
560 dnl Need to test if pkg-config exists
564 dnl Security driver checks
565 LIBVIRT_SECDRIVER_ARG_SELINUX
566 LIBVIRT_SECDRIVER_ARG_APPARMOR
568 LIBVIRT_SECDRIVER_CHECK_SELINUX
569 LIBVIRT_SECDRIVER_CHECK_APPARMOR
572 LIBVIRT_ARG_WITH_FEATURE([SECRETS], [local secrets management driver], [yes])
574 if test "$with_libvirtd" = "no"; then
577 if test "$with_secrets" = "yes" ; then
578 AC_DEFINE_UNQUOTED([WITH_SECRETS], 1, [whether local secrets management driver is available])
580 AM_CONDITIONAL([WITH_SECRETS], [test "$with_secrets" = "yes"])
584 dnl Storage driver checks
587 LIBVIRT_STORAGE_ARG_DIR
588 LIBVIRT_STORAGE_ARG_FS
589 LIBVIRT_STORAGE_ARG_LVM
590 LIBVIRT_STORAGE_ARG_ISCSI
591 LIBVIRT_STORAGE_ARG_ISCSI_DIRECT
592 LIBVIRT_STORAGE_ARG_SCSI
593 LIBVIRT_STORAGE_ARG_MPATH
594 LIBVIRT_STORAGE_ARG_DISK
595 LIBVIRT_STORAGE_ARG_RBD
596 LIBVIRT_STORAGE_ARG_SHEEPDOG
597 LIBVIRT_STORAGE_ARG_GLUSTER
598 LIBVIRT_STORAGE_ARG_ZFS
599 LIBVIRT_STORAGE_ARG_VSTORAGE
601 if test "$with_libvirtd" = "no"; then
605 with_storage_iscsi=no
606 with_storage_iscsi_direct=no
608 with_storage_mpath=no
611 with_storage_sheepdog=no
612 with_storage_gluster=no
614 with_storage_vstorage=no
617 dnl storage-fs does not work on macOS
619 if test "$with_macos" = "yes"; then
623 LIBVIRT_STORAGE_CHECK_DIR
624 LIBVIRT_STORAGE_CHECK_FS
625 LIBVIRT_STORAGE_CHECK_LVM
626 LIBVIRT_STORAGE_CHECK_ISCSI
627 LIBVIRT_STORAGE_CHECK_ISCSI_DIRECT
628 LIBVIRT_STORAGE_CHECK_SCSI
629 LIBVIRT_STORAGE_CHECK_MPATH
630 LIBVIRT_STORAGE_CHECK_DISK
631 LIBVIRT_STORAGE_CHECK_RBD
632 LIBVIRT_STORAGE_CHECK_SHEEPDOG
633 LIBVIRT_STORAGE_CHECK_GLUSTER
634 LIBVIRT_STORAGE_CHECK_ZFS
635 LIBVIRT_STORAGE_CHECK_VSTORAGE
638 for backend in dir fs lvm iscsi iscsi_direct scsi mpath rbd disk; do
639 if eval test \$with_storage_$backend = yes; then
644 if test $with_storage = yes; then
645 AC_DEFINE([WITH_STORAGE], [1],
646 [Define to 1 if at least one storage backend is in use])
648 AM_CONDITIONAL([WITH_STORAGE], [test "$with_storage" = "yes"])
651 dnl check for kernel headers required by btrfs ioctl
653 if test "$with_linux" = "yes"; then
654 AC_CHECK_HEADERS([linux/btrfs.h])
658 dnl check for xfs dev headers required by xfs ioctl
660 if test "$with_linux" = "yes"; then
661 AC_CHECK_HEADERS([xfs/xfs.h])
665 dnl check for DEVLINK_CMD_ESWITCH_GET
667 dnl Assume DEVLINK_ESWITCH_MODE_SWITCHDEV is also
668 dnl available, as it was introudced in kernel 4.8
669 dnl along with the original spelling of this constant
670 dnl (DEVLINK_CMD_ESWITCH_MODE_GET, not supported by libvirt)
672 if test "$with_linux" = "yes"; then
673 AC_CHECK_HEADERS([linux/devlink.h])
674 AC_CHECK_DECLS([DEVLINK_CMD_ESWITCH_GET], [], [],
675 [[#include <linux/devlink.h>]])
679 dnl check for VHOST_VSOCK_SET_GUEST_CID
681 if test "$with_linux" = "yes"; then
682 AC_CHECK_DECLS([VHOST_VSOCK_SET_GUEST_CID], [], [],
683 [[#include <linux/vhost.h>]])
686 dnl Allow perl/python overrides
687 AC_PATH_PROGS([PYTHON], [python3 python2 python])
688 if test -z "$PYTHON"; then
689 AC_MSG_ERROR(['python3', 'python2' or 'python' binary is required to build libvirt])
691 AC_PATH_PROG([PERL], [perl])
692 if test -z "$PERL"; then
693 AC_MSG_ERROR(['perl' binary is required to build libvirt])
696 LIBVIRT_ARG_WITH([TEST_SUITE], [build test suite by default], [check])
697 case "$with_test_suite" in
699 *) AC_MSG_ERROR([bad value ${withval} for tests option]) ;;
702 AC_MSG_CHECKING([Whether to build test suite by default])
703 if test "$with_test_suite" = "check" ; then
704 if test -d $srcdir/.git ; then
710 AC_MSG_RESULT([$with_test_suite])
711 AM_CONDITIONAL([WITH_TESTS], [test "$with_test_suite" = "yes"])
713 LIBVIRT_ARG_ENABLE([EXPENSIVE_TESTS],
714 [set the default for enabling expensive tests ]
715 [(gnulib and long timeouts), use VIR_TEST_EXPENSIVE to ]
716 [override during make],
718 case "$enable_expensive_tests" in
719 0|no) VIR_TEST_EXPENSIVE_DEFAULT=0 ;;
720 1|yes) VIR_TEST_EXPENSIVE_DEFAULT=1 ;;
722 *) AC_MSG_ERROR([bad value ${enable_expensive_tests} for enable-expensive-tests option]) ;;
724 if test "$enable_expensive_tests" = check; then
725 if test -d $srcdir/.git ; then
726 VIR_TEST_EXPENSIVE_DEFAULT=0
728 VIR_TEST_EXPENSIVE_DEFAULT=1
731 AC_SUBST([VIR_TEST_EXPENSIVE_DEFAULT])
732 AM_CONDITIONAL([WITH_EXPENSIVE_TESTS], [test $VIR_TEST_EXPENSIVE_DEFAULT = 1])
734 LIBVIRT_ARG_ENABLE([TEST_OOM], [memory allocation failure checking], [no])
735 case "$enable_test_oom" in
737 *) AC_MSG_ERROR([bad value ${enable_test_oom} for test-oom option]) ;;
740 if test "$enable_test_oom" = yes; then
742 AC_CHECK_HEADER([execinfo.h],[],[have_trace=no])
743 AC_CHECK_FUNC([backtrace],[],[have_trace=no])
744 if test "$have_trace" = "yes"; then
745 AC_DEFINE([TEST_OOM_TRACE], 1, [Whether backtrace() is available])
747 AC_DEFINE([TEST_OOM], 1, [Whether malloc OOM checking is enabled])
750 LIBVIRT_ARG_ENABLE([TEST_LOCKING], [thread locking tests using CIL], [no])
751 case "$enable_test_locking" in
753 *) AC_MSG_ERROR([bad value ${enable_test_locking} for test-locking option]) ;;
756 if test "$enable_test_locking" = "yes"; then
757 LOCK_CHECKING_CFLAGS="-save-temps"
758 AC_SUBST([LOCK_CHECKING_CFLAGS])
760 AM_CONDITIONAL([WITH_CIL],[test "$enable_test_locking" = "yes"])
762 dnl Cygwin, MinGW and MSVC checks
763 LIBVIRT_WIN_CHECK_COMMON
764 LIBVIRT_WIN_CHECK_CYGWIN
765 LIBVIRT_WIN_CHECK_MINGW
766 LIBVIRT_WIN_CHECK_SYMBOLS
767 LIBVIRT_WIN_CHECK_WINDRES
770 dnl Driver-Modules library support
771 LIBVIRT_ARG_DRIVER_MODULES
772 LIBVIRT_CHECK_DRIVER_MODULES
775 # Set LV_LIBTOOL_OBJDIR to "." or $lt_cv_objdir, depending on whether
776 # we're building shared libraries. This is the name of the directory
777 # in which .o files will be created.
778 test "$enable_shared" = no && lt_cv_objdir=.
779 LV_LIBTOOL_OBJDIR=${lt_cv_objdir-.}
780 AC_SUBST([LV_LIBTOOL_OBJDIR])
784 if test "$with_hal" = "yes" || test "$with_udev" = "yes";
787 AC_DEFINE_UNQUOTED([WITH_NODE_DEVICES], 1, [with node device driver])
789 AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"])
791 dnl GET_VLAN_VID_CMD is required for virNetDevGetVLanID
792 AC_CHECK_DECLS([GET_VLAN_VID_CMD], [], [], [[#include <linux/if_vlan.h>]])
794 # Check for Linux vs. BSD ifreq members
795 AC_CHECK_MEMBERS([struct ifreq.ifr_newname,
796 struct ifreq.ifr_ifindex,
797 struct ifreq.ifr_index,
798 struct ifreq.ifr_hwaddr],
800 [#include <sys/socket.h>
804 # Check for BSD approach for setting MAC addr
805 AC_LINK_IFELSE([AC_LANG_PROGRAM(
807 #include <sys/types.h>
808 #include <sys/socket.h>
809 #include <net/if_dl.h>
813 [AC_DEFINE([HAVE_DECL_LINK_ADDR],
815 [whether link_addr is available])])
817 # Check for BSD approach for bridge management
818 AC_CHECK_DECLS([BRDGSFD, BRDGADD, BRDGDEL],
819 [AC_DEFINE([HAVE_BSD_BRIDGE_MGMT],
821 [whether BSD style bridge management is available])],
825 #include <net/ethernet.h>
826 #include <net/if_bridgevar.h>
829 # Check for BSD CPU affinity availability
830 AC_CHECK_DECLS([cpuset_getaffinity],
831 [AC_DEFINE([HAVE_BSD_CPU_AFFINITY],
833 [whether BSD CPU affinity management is available])],
835 [#include <sys/param.h>
836 #include <sys/cpuset.h>
839 # Check for BSD kvm (kernel memory interface)
840 if test $with_freebsd = yes; then
841 AC_CHECK_LIB([kvm], [kvm_getprocs], [],
842 [AC_MSG_ERROR([BSD kernel memory interface library is required to build on FreeBSD])]
846 # FreeBSD 10-STABLE requires _IFI_OQDROPS to be defined for if_data.ifi_oqdrops
849 CFLAGS="$CFLAGS -D_IFI_OQDROPS"
851 AC_CHECK_MEMBERS([struct if_data.ifi_oqdrops],
853 [CFLAGS="$old_CFLAGS"],
857 AC_CHECK_DECLS([clock_serv_t, host_get_clock_service, clock_get_time],
858 [AC_DEFINE([HAVE_MACH_CLOCK_ROUTINES],
860 [whether Mach clock routines are available])],
862 [#include <mach/clock.h>
863 #include <mach/mach.h>
866 # Check if we need to look for ifconfig
867 if test "$want_ifconfig" = "yes"; then
868 AC_PATH_PROG([IFCONFIG_PATH], [ifconfig])
869 if test -z "$IFCONFIG_PATH"; then
870 AC_MSG_ERROR([Failed to find ifconfig.])
872 AC_DEFINE_UNQUOTED([IFCONFIG_PATH], "$IFCONFIG_PATH", [path to ifconfig binary])
875 # Detect when running under the clang static analyzer's scan-build driver
876 # or Coverity-prevent's cov-build. Define STATIC_ANALYSIS accordingly.
877 AC_CACHE_CHECK([whether this build is done by a static analysis tool],
878 [lv_cv_static_analysis], [
879 lv_cv_static_analysis=no
880 if test -n "${CCC_ANALYZER_ANALYSIS+set}" || \
881 test -n "$COVERITY_BUILD_COMMAND$COVERITY_LD_PRELOAD"; then
882 lv_cv_static_analysis=yes
886 test "x$lv_cv_static_analysis" = xyes && t=1
887 AC_DEFINE_UNQUOTED([STATIC_ANALYSIS], [$t],
888 [Define to 1 when performing static analysis.])
890 # Some GNULIB base64 symbols clash with a kerberos library
891 AC_DEFINE_UNQUOTED([isbase64],[libvirt_gl_isbase64],[Hack to avoid symbol clash])
892 AC_DEFINE_UNQUOTED([base64_encode],[libvirt_gl_base64_encode],[Hack to avoid symbol clash])
893 AC_DEFINE_UNQUOTED([base64_encode_alloc],[libvirt_gl_base64_encode_alloc],[Hack to avoid symbol clash])
895 AC_CONFIG_FILES([run],
898 Makefile src/Makefile include/libvirt/Makefile docs/Makefile \
899 gnulib/lib/Makefile \
900 gnulib/tests/Makefile \
908 src/libvirt-qemu.pc \
910 libvirt.spec mingw-libvirt.spec \
912 include/libvirt/libvirt-common.h \
919 AC_MSG_NOTICE([Configuration summary])
920 AC_MSG_NOTICE([=====================])
922 AC_MSG_NOTICE([Drivers])
924 LIBVIRT_DRIVER_RESULT_QEMU
925 LIBVIRT_DRIVER_RESULT_OPENVZ
926 LIBVIRT_DRIVER_RESULT_VMWARE
927 LIBVIRT_DRIVER_RESULT_VBOX
928 LIBVIRT_DRIVER_RESULT_XENAPI
929 LIBVIRT_DRIVER_RESULT_LIBXL
930 LIBVIRT_DRIVER_RESULT_LXC
931 LIBVIRT_DRIVER_RESULT_PHYP
932 LIBVIRT_DRIVER_RESULT_ESX
933 LIBVIRT_DRIVER_RESULT_HYPERV
934 LIBVIRT_DRIVER_RESULT_VZ
935 LIBVIRT_DRIVER_RESULT_BHYVE
936 LIBVIRT_DRIVER_RESULT_TEST
937 LIBVIRT_DRIVER_RESULT_REMOTE
938 LIBVIRT_DRIVER_RESULT_NETWORK
939 LIBVIRT_DRIVER_RESULT_LIBVIRTD
940 LIBVIRT_DRIVER_RESULT_INTERFACE
942 AC_MSG_NOTICE([Storage Drivers])
944 LIBVIRT_STORAGE_RESULT_DIR
945 LIBVIRT_STORAGE_RESULT_FS
946 LIBVIRT_STORAGE_RESULT_LVM
947 LIBVIRT_STORAGE_RESULT_ISCSI
948 LIBVIRT_STORAGE_RESULT_ISCSI_DIRECT
949 LIBVIRT_STORAGE_RESULT_SCSI
950 LIBVIRT_STORAGE_RESULT_MPATH
951 LIBVIRT_STORAGE_RESULT_DISK
952 LIBVIRT_STORAGE_RESULT_RBD
953 LIBVIRT_STORAGE_RESULT_SHEEPDOG
954 LIBVIRT_STORAGE_RESULT_GLUSTER
955 LIBVIRT_STORAGE_RESULT_ZFS
956 LIBVIRT_STORAGE_RESULT_VSTORAGE
958 AC_MSG_NOTICE([Security Drivers])
960 LIBVIRT_SECDRIVER_RESULT_SELINUX
961 LIBVIRT_SECDRIVER_RESULT_APPARMOR
963 AC_MSG_NOTICE([Driver Loadable Modules])
965 LIBVIRT_RESULT_DRIVER_MODULES
967 AC_MSG_NOTICE([Libraries])
970 LIBVIRT_RESULT_APPARMOR
974 LIBVIRT_RESULT_BASH_COMPLETION
979 LIBVIRT_RESULT_DLOPEN
980 LIBVIRT_RESULT_FIREWALLD
981 LIBVIRT_RESULT_FIREWALLD_ZONE
983 LIBVIRT_RESULT_GLUSTER
984 LIBVIRT_RESULT_GNUTLS
986 LIBVIRT_RESULT_LIBISCSI
988 LIBVIRT_RESULT_LIBPCAP
989 LIBVIRT_RESULT_LIBSSH
991 LIBVIRT_RESULT_LIBXML
992 LIBVIRT_RESULT_MACVTAP
996 LIBVIRT_RESULT_NUMACTL
997 LIBVIRT_RESULT_OPENWSMAN
998 LIBVIRT_RESULT_PCIACCESS
999 LIBVIRT_RESULT_PM_UTILS
1000 LIBVIRT_RESULT_POLKIT
1002 LIBVIRT_RESULT_READLINE
1003 LIBVIRT_RESULT_SANLOCK
1005 LIBVIRT_RESULT_SELINUX
1008 LIBVIRT_RESULT_VIRTUALPORT
1010 LIBVIRT_RESULT_XENAPI
1013 AC_MSG_NOTICE([Windows])
1015 LIBVIRT_WIN_RESULT_COMMON
1016 LIBVIRT_WIN_RESULT_WINDRES
1018 AC_MSG_NOTICE([Test suite])
1020 AC_MSG_NOTICE([ Alloc OOM: $enable_test_oom])
1022 AC_MSG_NOTICE([Miscellaneous])
1024 LIBVIRT_RESULT_DEBUG
1025 AC_MSG_NOTICE([ Use -Werror: $enable_werror])
1026 AC_MSG_NOTICE([ Warning Flags: $WARN_CFLAGS])
1027 LIBVIRT_RESULT_DTRACE
1028 LIBVIRT_RESULT_NUMAD
1029 LIBVIRT_RESULT_INIT_SCRIPT
1030 LIBVIRT_RESULT_CHRDEV_LOCK_FILES
1031 LIBVIRT_RESULT_DEFAULT_EDITOR
1032 LIBVIRT_RESULT_LOADER_NVRAM
1033 LIBVIRT_RESULT_LOGIN_SHELL
1034 LIBVIRT_RESULT_HOST_VALIDATE
1035 LIBVIRT_RESULT_TLS_PRIORITY
1037 AC_MSG_NOTICE([Developer Tools])
1039 LIBVIRT_RESULT_WIRESHARK
1041 AC_MSG_NOTICE([Privileges])
1043 LIBVIRT_RESULT_QEMU_PRIVILEGES