Commit ae6b5e5afd991b52ab2bc2c13ef18837544d741d

Authored by aliguori
1 parent 95f9397c

Fix gnutls autodetection when using a cross-compiler.

It is not enough to check for pkg-config gnutls.  You may be using a
cross-compiler and have gnutls available on the host but not for the target.
This patch changes the detection to try and build an application using gnutls
and whatever compiler is available.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>




git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4989 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 12 additions and 5 deletions
configure
... ... @@ -737,11 +737,18 @@ fi # -z $sdl
737 737 ##########################################
738 738 # VNC TLS detection
739 739 if test "$vnc_tls" = "yes" ; then
740   - `pkg-config gnutls` || vnc_tls="no"
741   -fi
742   -if test "$vnc_tls" = "yes" ; then
743   - vnc_tls_cflags=`pkg-config --cflags gnutls`
744   - vnc_tls_libs=`pkg-config --libs gnutls`
  740 +cat > $TMPC <<EOF
  741 +#include <gnutls/gnutls.h>
  742 +int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
  743 +EOF
  744 + vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null`
  745 + vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null`
  746 + if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
  747 + $vnc_tls_libs 2> /dev/null ; then
  748 + :
  749 + else
  750 + vnc_tls="no"
  751 + fi
745 752 fi
746 753  
747 754 ##########################################
... ...