mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-31 05:57:16 +00:00
build: hoist system-specific checks before library checks
Commit f92c7e3
fixed a regression for native builds, but introduced
a regression for cross-compilation builds; in particular,
./autobuild.sh on a Fedora system with mingw cross-compiler fails
with:
checking for qemu-kvm... /usr/bin/qemu-kvm
checking for yajl_parse_complete in -lyajl... no
checking for yajl_tree_parse in -lyajl... no
configure: error: You must install the libyajl library & headers to compile libvirt
Since we default $with_qemu to 'yes' rather than 'check', and then
flip that default based on platform-specific checks, those platform
specifics need to come prior to any library checks that depend on
the value of $with_qemu.
* configure.ac: Ensure system defaults are sane before checking
for things that make decisions based on system default.
Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
ceaa536d49
commit
0e1f012c1d
85
configure.ac
85
configure.ac
@ -160,6 +160,50 @@ VERSION_SCRIPT_FLAGS=-Wl,--version-script=
|
|||||||
VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
|
VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
|
||||||
AC_MSG_RESULT([$VERSION_SCRIPT_FLAGS])
|
AC_MSG_RESULT([$VERSION_SCRIPT_FLAGS])
|
||||||
|
|
||||||
|
dnl Specify if we rely on ifconfig instead of iproute2 (e.g. in case
|
||||||
|
dnl we're working on BSD)
|
||||||
|
want_ifconfig=no
|
||||||
|
|
||||||
|
dnl Make some notes about which OS we're compiling for, as the lxc and qemu
|
||||||
|
dnl drivers require linux headers, and storage_mpath, dtrace, and nwfilter
|
||||||
|
dnl are also linux specific. The "network" and storage_fs drivers are known
|
||||||
|
dnl to not work on MacOS X presently, so we also make a note if compiling
|
||||||
|
dnl for that
|
||||||
|
|
||||||
|
with_linux=no with_osx=no with_freebsd=no
|
||||||
|
case $host in
|
||||||
|
*-*-linux*) with_linux=yes ;;
|
||||||
|
*-*-darwin*) with_osx=yes ;;
|
||||||
|
*-*-freebsd*) with_freebsd=yes ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test $with_linux = no; then
|
||||||
|
if test "x$with_lxc" != xyes
|
||||||
|
then
|
||||||
|
with_lxc=no
|
||||||
|
fi
|
||||||
|
with_dtrace=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $with_freebsd = yes; then
|
||||||
|
want_ifconfig=yes
|
||||||
|
|
||||||
|
with_firewalld=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $with_osx = yes; then
|
||||||
|
with_qemu=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
|
||||||
|
AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"])
|
||||||
|
|
||||||
|
if test "$with_libvirtd" = "no" ; then
|
||||||
|
with_qemu=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check for compiler and library settings.
|
||||||
|
|
||||||
LIBVIRT_COMPILE_WARNINGS
|
LIBVIRT_COMPILE_WARNINGS
|
||||||
LIBVIRT_COMPILE_PIE
|
LIBVIRT_COMPILE_PIE
|
||||||
LIBVIRT_LINKER_RELRO
|
LIBVIRT_LINKER_RELRO
|
||||||
@ -391,44 +435,6 @@ if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then
|
|||||||
sysconfdir='/etc'
|
sysconfdir='/etc'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl Specify if we rely on ifconfig instead of iproute2 (e.g. in case
|
|
||||||
dnl we're working on BSD)
|
|
||||||
want_ifconfig=no
|
|
||||||
|
|
||||||
dnl Make some notes about which OS we're compiling for, as the lxc and qemu
|
|
||||||
dnl drivers require linux headers, and storage_mpath, dtrace, and nwfilter
|
|
||||||
dnl are also linux specific. The "network" and storage_fs drivers are known
|
|
||||||
dnl to not work on MacOS X presently, so we also make a note if compiling
|
|
||||||
dnl for that
|
|
||||||
|
|
||||||
with_linux=no with_osx=no with_freebsd=no
|
|
||||||
case $host in
|
|
||||||
*-*-linux*) with_linux=yes ;;
|
|
||||||
*-*-darwin*) with_osx=yes ;;
|
|
||||||
*-*-freebsd*) with_freebsd=yes ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if test $with_linux = no; then
|
|
||||||
if test "x$with_lxc" != xyes
|
|
||||||
then
|
|
||||||
with_lxc=no
|
|
||||||
fi
|
|
||||||
with_dtrace=no
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $with_freebsd = yes; then
|
|
||||||
want_ifconfig=yes
|
|
||||||
|
|
||||||
with_firewalld=no
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $with_osx = yes; then
|
|
||||||
with_qemu=no
|
|
||||||
fi
|
|
||||||
|
|
||||||
AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
|
|
||||||
AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"])
|
|
||||||
|
|
||||||
dnl Allow to build without Xen, QEMU/KVM, test or remote driver
|
dnl Allow to build without Xen, QEMU/KVM, test or remote driver
|
||||||
AC_ARG_WITH([xen],
|
AC_ARG_WITH([xen],
|
||||||
[AS_HELP_STRING([--with-xen],
|
[AS_HELP_STRING([--with-xen],
|
||||||
@ -721,9 +727,6 @@ if test "x$with_vbox" = "xyes"; then
|
|||||||
fi
|
fi
|
||||||
AM_CONDITIONAL([WITH_VBOX], [test "$with_vbox" = "yes"])
|
AM_CONDITIONAL([WITH_VBOX], [test "$with_vbox" = "yes"])
|
||||||
|
|
||||||
if test "$with_libvirtd" = "no" ; then
|
|
||||||
with_qemu=no
|
|
||||||
fi
|
|
||||||
if test "$with_qemu" = "yes" ; then
|
if test "$with_qemu" = "yes" ; then
|
||||||
AC_DEFINE_UNQUOTED([WITH_QEMU], 1, [whether QEMU driver is enabled])
|
AC_DEFINE_UNQUOTED([WITH_QEMU], 1, [whether QEMU driver is enabled])
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user