From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIgsl-0002oz-5U for qemu-devel@nongnu.org; Fri, 24 Jul 2015 13:35:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZIgsh-0004Eh-M6 for qemu-devel@nongnu.org; Fri, 24 Jul 2015 13:35:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIgsh-0004ES-Cj for qemu-devel@nongnu.org; Fri, 24 Jul 2015 13:35:35 -0400 Date: Fri, 24 Jul 2015 18:35:30 +0100 From: "Daniel P. Berrange" Message-ID: <20150724173530.GZ6880@redhat.com> References: <1437758888-22486-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1437758888-22486-1-git-send-email-peter.maydell@linaro.org> Subject: Re: [Qemu-devel] [PATCH] configure: Work around broken static pkg-config info for Ubuntu gnutls Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , qemu-devel@nongnu.org, patches@linaro.org On Fri, Jul 24, 2015 at 06:28:08PM +0100, Peter Maydell wrote: > 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 Reviewed-by: Daniel P. Berrange Looks like a reasonable approach to me. > --- > configure | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > > diff --git a/configure b/configure > index cc0338d..704b34c 100755 > --- a/configure > +++ b/configure > @@ -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" Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|