diff options
| author | Peter Maydell | 2015-07-24 19:28:08 +0200 |
|---|---|---|
| committer | Peter Maydell | 2015-07-27 17:15:32 +0200 |
| commit | 3737129917c918767cdb8acd8ca6b342c45fa154 (patch) | |
| tree | b123ad49ac0dab244e4977fc04ad36937f42f239 /configure | |
| parent | Merge remote-tracking branch 'remotes/stefanha/tags/net-pull-request' into st... (diff) | |
| download | qemu-3737129917c918767cdb8acd8ca6b342c45fa154.tar.gz qemu-3737129917c918767cdb8acd8ca6b342c45fa154.tar.xz qemu-3737129917c918767cdb8acd8ca6b342c45fa154.zip | |
configure: Work around broken static pkg-config info for Ubuntu gnutls
Unfortunately Ubuntu's pkg-config information for gnutls is broken
for the static linking case, and outputs --libs options which the
compiler does not recognize. Work around this problem by testing
that the --cflags/--libs output will at least allow compilation
before enabling gnutls support.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Message-id: 1437758888-22486-1-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -2116,10 +2116,26 @@ fi ########################################## # GNUTLS probe +gnutls_works() { + # Unfortunately some distros have bad pkg-config information for gnutls + # such that it claims to exist but you get a compiler error if you try + # to use the options returned by --libs. Specifically, Ubuntu for --static + # builds doesn't work: + # https://bugs.launchpad.net/ubuntu/+source/gnutls26/+bug/1478035 + # + # So sanity check the cflags/libs before assuming gnutls can be used. + if ! $pkg_config --exists "gnutls"; then + return 1 + fi + + write_c_skeleton + compile_prog "$($pkg_config --cflags gnutls)" "$($pkg_config --libs gnutls)" +} + gnutls_gcrypt=no gnutls_nettle=no if test "$gnutls" != "no"; then - if $pkg_config --exists "gnutls"; then + if gnutls_works; then gnutls_cflags=`$pkg_config --cflags gnutls` gnutls_libs=`$pkg_config --libs gnutls` libs_softmmu="$gnutls_libs $libs_softmmu" |
