summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-08-06 16:55:50 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-08-06 16:55:50 +0000
commitae6b5e5afd991b52ab2bc2c13ef18837544d741d (patch)
tree0ca5bd8043ba3772f5e725220775683b414375a6 /configure
parent95f9397c75fad78ccb9eb8e878035554f0e3763d (diff)
downloadqemu-ae6b5e5afd991b52ab2bc2c13ef18837544d741d.tar.gz
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
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure17
1 files changed, 12 insertions, 5 deletions
diff --git a/configure b/configure
index 0a3b7c9869..bca3143902 100755
--- a/configure
+++ b/configure
@@ -737,11 +737,18 @@ fi # -z $sdl
##########################################
# VNC TLS detection
if test "$vnc_tls" = "yes" ; then
- `pkg-config gnutls` || vnc_tls="no"
-fi
-if test "$vnc_tls" = "yes" ; then
- vnc_tls_cflags=`pkg-config --cflags gnutls`
- vnc_tls_libs=`pkg-config --libs gnutls`
+cat > $TMPC <<EOF
+#include <gnutls/gnutls.h>
+int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
+EOF
+ vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null`
+ vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null`
+ if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
+ $vnc_tls_libs 2> /dev/null ; then
+ :
+ else
+ vnc_tls="no"
+ fi
fi
##########################################