netmap="no"
pixman=""
sdl=""
-sdlabi="1.2"
+sdlabi=""
virtfs=""
vnc="yes"
sparse="no"
usb_redir=""
opengl=""
opengl_dmabuf="no"
+avx2_opt="no"
zlib="yes"
lzo=""
snappy=""
coroutine_pool=""
seccomp=""
glusterfs=""
+glusterfs_xlator_opt="no"
glusterfs_discard="no"
glusterfs_zerofill="no"
archipelago="no"
gtk_gl="no"
gnutls=""
gnutls_hash=""
+gnutls_rnd=""
nettle=""
+nettle_kdf="no"
gcrypt=""
+gcrypt_kdf="no"
vte=""
virglrenderer=""
tpm="yes"
fi
##########################################
+# avx2 optimization requirement check
+
+cat > $TMPC << EOF
+static void bar(void) {}
+static void *bar_ifunc(void) {return (void*) bar;}
+static void foo(void) __attribute__((ifunc("bar_ifunc")));
+int main(void) { foo(); return 0; }
+EOF
+if compile_prog "-mavx2" "" ; then
+ if readelf --syms $TMPE |grep "IFUNC.*foo" >/dev/null 2>&1; then
+ avx2_opt="yes"
+ fi
+fi
+
+#########################################
# zlib check
if test "$zlib" != "no" ; then
i386|x86_64)
libseccomp_minver="2.1.0"
;;
+ mips)
+ libseccomp_minver="2.2.0"
+ ;;
arm|aarch64)
libseccomp_minver="2.2.3"
;;
if $pkg_config --exists "$gtkpackage >= $gtkversion"; then
gtk_cflags=`$pkg_config --cflags $gtkpackage`
gtk_libs=`$pkg_config --libs $gtkpackage`
+ gtk_version=`$pkg_config --modversion $gtkpackage`
if $pkg_config --exists "$gtkx11package >= $gtkversion"; then
gtk_cflags="$gtk_cflags $x11_cflags"
gtk_libs="$gtk_libs $x11_libs"
gnutls_hash="no"
fi
+ # gnutls_rnd requires >= 2.11.0
+ if $pkg_config --exists "gnutls >= 2.11.0"; then
+ gnutls_rnd="yes"
+ else
+ gnutls_rnd="no"
+ fi
+
if $pkg_config --exists 'gnutls >= 3.0'; then
gnutls_gcrypt=no
gnutls_nettle=yes
else
gnutls="no"
gnutls_hash="no"
+ gnutls_rnd="no"
fi
else
gnutls_hash="no"
+ gnutls_rnd="no"
fi
if test -z "$nettle"; then
nettle="no"
fi
+
+ cat > $TMPC << EOF
+#include <gcrypt.h>
+int main(void) {
+ gcry_kdf_derive(NULL, 0, GCRY_KDF_PBKDF2,
+ GCRY_MD_SHA256,
+ NULL, 0, 0, 0, NULL);
+ return 0;
+}
+EOF
+ if compile_prog "$gcrypt_cflags" "$gcrypt_libs" ; then
+ gcrypt_kdf=yes
+ fi
else
if test "$gcrypt" = "yes"; then
feature_not_found "gcrypt" "Install gcrypt devel"
libs_tools="$nettle_libs $libs_tools"
QEMU_CFLAGS="$QEMU_CFLAGS $nettle_cflags"
nettle="yes"
+
+ cat > $TMPC << EOF
+#include <nettle/pbkdf2.h>
+int main(void) {
+ pbkdf2_hmac_sha256(8, NULL, 1000, 8, NULL, 8, NULL);
+ return 0;
+}
+EOF
+ if compile_prog "$nettle_cflags" "$nettle_libs" ; then
+ nettle_kdf=yes
+ fi
else
if test "$nettle" = "yes"; then
feature_not_found "nettle" "Install nettle devel"
if test "$vte" != "no"; then
if test "$gtkabi" = "3.0"; then
- vtepackage="vte-2.90"
- vteversion="0.32.0"
+ vteminversion="0.32.0"
+ if $pkg_config --exists "vte-2.91"; then
+ vtepackage="vte-2.91"
+ else
+ vtepackage="vte-2.90"
+ fi
else
vtepackage="vte"
- vteversion="0.24.0"
+ vteminversion="0.24.0"
fi
- if $pkg_config --exists "$vtepackage >= $vteversion"; then
+ if $pkg_config --exists "$vtepackage >= $vteminversion"; then
vte_cflags=`$pkg_config --cflags $vtepackage`
vte_libs=`$pkg_config --libs $vtepackage`
+ vteversion=`$pkg_config --modversion $vtepackage`
libs_softmmu="$vte_libs $libs_softmmu"
vte="yes"
elif test "$vte" = "yes"; then
if test "$gtkabi" = "3.0"; then
- feature_not_found "vte" "Install libvte-2.90 devel"
+ feature_not_found "vte" "Install libvte-2.90/2.91 devel"
else
feature_not_found "vte" "Install libvte devel"
fi
# Look for sdl configuration program (pkg-config or sdl-config). Try
# sdl-config even without cross prefix, and favour pkg-config over sdl-config.
+if test "$sdlabi" = ""; then
+ if $pkg_config --exists "sdl"; then
+ sdlabi=1.2
+ elif $pkg_config --exists "sdl2"; then
+ sdlabi=2.0
+ else
+ sdlabi=1.2
+ fi
+fi
+
if test $sdlabi = "2.0"; then
sdl_config=$sdl2_config
sdlname=sdl2
sdlconfigname=sdl2_config
-else
+elif test $sdlabi = "1.2"; then
sdlname=sdl
sdlconfigname=sdl_config
+else
+ error_exit "Unknown sdlabi $sdlabi, must be 1.2 or 2.0"
fi
if test "`basename $sdl_config`" != $sdlconfigname && ! has ${sdl_config}; then
if $pkg_config $sdlname --exists; then
sdlconfig="$pkg_config $sdlname"
- _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'`
+ sdlversion=`$sdlconfig --modversion 2>/dev/null`
elif has ${sdl_config}; then
sdlconfig="$sdl_config"
- _sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'`
+ sdlversion=`$sdlconfig --version`
else
if test "$sdl" = "yes" ; then
feature_not_found "sdl" "Install SDL devel"
sdl_libs=`$sdlconfig --libs 2> /dev/null`
fi
if compile_prog "$sdl_cflags" "$sdl_libs" ; then
- if test "$_sdlversion" -lt 121 ; then
+ if test `echo $sdlversion | sed 's/[^0-9]//g'` -lt 121 ; then
sdl_too_old=yes
else
sdl=yes
# curses probe
if test "$curses" != "no" ; then
if test "$mingw32" = "yes" ; then
- curses_list="-lpdcurses"
+ curses_list="$($pkg_config --libs ncurses 2>/dev/null):-lpdcurses"
else
curses_list="$($pkg_config --libs ncurses 2>/dev/null):-lncurses:-lcurses"
fi
}
EOF
-if ! compile_prog "-Werror $CFLAGS" "$LIBS" ; then
+if ! compile_prog "$CFLAGS" "$LIBS" ; then
error_exit "sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T."\
"You probably need to set PKG_CONFIG_LIBDIR"\
"to point to the right pkg-config files for your"\
glusterfs="yes"
glusterfs_cflags=`$pkg_config --cflags glusterfs-api`
glusterfs_libs=`$pkg_config --libs glusterfs-api`
+ if $pkg_config --atleast-version=4 glusterfs-api; then
+ glusterfs_xlator_opt="yes"
+ fi
if $pkg_config --atleast-version=5 glusterfs-api; then
glusterfs_discard="yes"
fi
fi
fi
+##########################################
+# check if struct fsxattr is available via linux/fs.h
+
+have_fsxattr=no
+cat > $TMPC << EOF
+#include <linux/fs.h>
+struct fsxattr foo;
+int main(void) {
+ return 0;
+}
+EOF
+if compile_prog "" "" ; then
+ have_fsxattr=yes
+fi
+
##########################################
# End of CC checks
# After here, no more $cc or $ld runs
tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)"
else
if test "$virtfs" = yes; then
- error_exit "VirtFS is supported only on Linux and requires libcap-devel and libattr-devel"
+ error_exit "VirtFS is supported only on Linux and requires libcap devel and libattr devel"
fi
virtfs=no
fi
fi
fi
+echo_version() {
+ if test "$1" = "yes" ; then
+ echo "($2)"
+ fi
+}
+
# prepend pixman and ftd flags after all config tests are done
QEMU_CFLAGS="$pixman_cflags $fdt_cflags $QEMU_CFLAGS"
libs_softmmu="$pixman_libs $libs_softmmu"
echo "Cocoa support $cocoa"
fi
echo "pixman $pixman"
-echo "SDL support $sdl"
-echo "GTK support $gtk"
+echo "SDL support $sdl `echo_version $sdl $sdlversion`"
+echo "GTK support $gtk `echo_version $gtk $gtk_version`"
echo "GTK GL support $gtk_gl"
+echo "VTE support $vte `echo_version $vte $vteversion`"
echo "GNUTLS support $gnutls"
echo "GNUTLS hash $gnutls_hash"
+echo "GNUTLS rnd $gnutls_rnd"
echo "libgcrypt $gcrypt"
-if test "$nettle" = "yes"; then
- echo "nettle $nettle ($nettle_version)"
-else
- echo "nettle $nettle"
-fi
+echo "libgcrypt kdf $gcrypt_kdf"
+echo "nettle $nettle `echo_version $nettle $nettle_version`"
+echo "nettle kdf $nettle_kdf"
echo "libtasn1 $tasn1"
-echo "VTE support $vte"
echo "curses support $curses"
echo "virgl support $virglrenderer"
echo "curl support $curl"
if have_backend "simple"; then
echo "Trace output file $trace_file-<pid>"
fi
-if test "$spice" = "yes"; then
-echo "spice support $spice ($spice_protocol_version/$spice_server_version)"
-else
-echo "spice support $spice"
-fi
+echo "spice support $spice `echo_version $spice $spice_protocol_version/$spice_server_version`"
echo "rbd support $rbd"
echo "xfsctl support $xfs"
echo "smartcard support $smartcard"
echo "NUMA host support $numa"
echo "tcmalloc support $tcmalloc"
echo "jemalloc support $jemalloc"
+echo "avx2 optimization $avx2_opt"
if test "$sdl_too_old" = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
if test "$gnutls_hash" = "yes" ; then
echo "CONFIG_GNUTLS_HASH=y" >> $config_host_mak
fi
+if test "$gnutls_rnd" = "yes" ; then
+ echo "CONFIG_GNUTLS_RND=y" >> $config_host_mak
+fi
if test "$gcrypt" = "yes" ; then
echo "CONFIG_GCRYPT=y" >> $config_host_mak
+ if test "$gcrypt_kdf" = "yes" ; then
+ echo "CONFIG_GCRYPT_KDF=y" >> $config_host_mak
+ fi
fi
if test "$nettle" = "yes" ; then
echo "CONFIG_NETTLE=y" >> $config_host_mak
echo "CONFIG_NETTLE_VERSION_MAJOR=${nettle_version%%.*}" >> $config_host_mak
+ if test "$nettle_kdf" = "yes" ; then
+ echo "CONFIG_NETTLE_KDF=y" >> $config_host_mak
+ fi
fi
if test "$tasn1" = "yes" ; then
echo "CONFIG_TASN1=y" >> $config_host_mak
if test "$have_ifaddrs_h" = "yes" ; then
echo "HAVE_IFADDRS_H=y" >> $config_host_mak
fi
+
+# Work around a system header bug with some kernel/XFS header
+# versions where they both try to define 'struct fsxattr':
+# xfs headers will not try to redefine structs from linux headers
+# if this macro is set.
+if test "$have_fsxattr" = "yes" ; then
+ echo "HAVE_FSXATTR=y" >> $config_host_mak
+fi
if test "$vte" = "yes" ; then
echo "CONFIG_VTE=y" >> $config_host_mak
echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak
fi
fi
+if test "$avx2_opt" = "yes" ; then
+ echo "CONFIG_AVX2_OPT=y" >> $config_host_mak
+fi
+
if test "$lzo" = "yes" ; then
echo "CONFIG_LZO=y" >> $config_host_mak
fi
echo "GLUSTERFS_LIBS=$glusterfs_libs" >> $config_host_mak
fi
+if test "$glusterfs_xlator_opt" = "yes" ; then
+ echo "CONFIG_GLUSTERFS_XLATOR_OPT=y" >> $config_host_mak
+fi
+
if test "$glusterfs_discard" = "yes" ; then
echo "CONFIG_GLUSTERFS_DISCARD=y" >> $config_host_mak
fi
EOD
printf "exec" >>config.status
printf " '%s'" "$0" "$@" >>config.status
-echo >>config.status
+echo ' "$@"' >>config.status
chmod +x config.status
rm -r "$TMPDIR1"