m4/virt-gnutls: properly backup CFLAGS and LIBS for AC_CHECK_* macros

Commit 943ddcb712 partially fixed this bug in gnutls configure code.
However we also need to backup and modify CFLAGS and do if for
AC_CHECK_HEADERS as well.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2016-12-22 14:09:43 +01:00
parent 0eb5fc5232
commit aac34eca90

View File

@ -54,15 +54,18 @@ AC_DEFUN([LIBVIRT_CHECK_GNUTLS],[
[set to 1 if it is known or assumed that GNUTLS uses gcrypt])
fi
OLD_CFLAGS="$CFLAGS"
OLD_LIBS="$LIBS"
CFLAGS="$CFLAGS $GNUTLS_CFLAGS"
LIBS="$LIBS $GNUTLS_LIBS"
AC_CHECK_HEADERS([gnutls/crypto.h], [], [], [[
#include <gnutls/gnutls.h>
]])
OLD_LIBS="$LIBS"
LIBS="$LIBS $GNUTLS_LIBS"
AC_CHECK_FUNCS([gnutls_rnd])
AC_CHECK_FUNCS([gnutls_cipher_encrypt])
LIBS=$OLD_LIBS
CFLAGS="$OLD_CFLAGS"
LIBS="$OLD_LIBS"
fi
])