From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
qemu-block@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Michael Tokarev" <mjt@tls.msk.ru>,
"Bharata B Rao" <bharata@linux.ibm.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Niels de Vos" <ndevos@redhat.com>
Subject: [Qemu-devel] [PATCH v2 6/9] configure: Link test before auto-enabling OpenGL libraries
Date: Fri, 14 Jun 2019 12:07:15 +0200 [thread overview]
Message-ID: <20190614100718.14019-7-philmd@redhat.com> (raw)
In-Reply-To: <20190614100718.14019-1-philmd@redhat.com>
Similarly to commit a73e82ef912, test the libraries link correctly
before considering them as usable.
This fixes using ./configure --static on Ubuntu 18.04:
$ make subdir-lm32-softmmu
[...]
LINK lm32-softmmu/qemu-system-lm32
/usr/bin/ld: cannot find -lepoxy
/usr/bin/ld: cannot find -lgbm
collect2: error: ld returned 1 exit status
Makefile:204: recipe for target 'qemu-system-lm32' failed
make[1]: *** [qemu-system-lm32] Error 1
$ fgrep epoxy config-host.mak
OPENGL_LIBS=-lepoxy -ldl -lgbm -ldl
$ lsb_release -cri
Distributor ID: Ubuntu
Release: 18.04
Codename: bionic
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
configure | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/configure b/configure
index 449dbd69ce..a3da5adf80 100755
--- a/configure
+++ b/configure
@@ -4133,11 +4133,21 @@ if test "$opengl" != "no" ; then
if $pkg_config $opengl_pkgs; then
opengl_cflags="$($pkg_config --cflags $opengl_pkgs)"
opengl_libs="$($pkg_config --libs $opengl_pkgs)"
- opengl=yes
- if test "$gtk" = "yes" && $pkg_config --exists "$gtkpackage >= 3.16"; then
- gtk_gl="yes"
+ # Packaging for the static libraries is not always correct.
+ # At least ubuntu 18.04 ships only shared libraries.
+ write_c_skeleton
+ if ! compile_prog "$opengl_cflags" "$opengl_libs" ; then
+ if test "$opengl" = "yes" ; then
+ error_exit "opengl check failed."
+ fi
+ opengl=no
+ else
+ opengl=yes
+ if test "$gtk" = "yes" && $pkg_config --exists "$gtkpackage >= 3.16"; then
+ gtk_gl="yes"
+ fi
+ QEMU_CFLAGS="$QEMU_CFLAGS $opengl_cflags"
fi
- QEMU_CFLAGS="$QEMU_CFLAGS $opengl_cflags"
else
if test "$opengl" = "yes" ; then
feature_not_found "opengl" "Please install opengl (mesa) devel pkgs: $opengl_pkgs"
--
2.20.1
next prev parent reply other threads:[~2019-06-14 10:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-14 10:07 [Qemu-devel] [PATCH v2 0/9] configure: Fix softmmu --static linking Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 1/9] configure: Only generate GLUSTERFS variables if glusterfs is usable Philippe Mathieu-Daudé
2019-07-01 14:29 ` Daniel P. Berrangé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 2/9] configure: Link test before auto-enabling GlusterFS libraries Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 3/9] configure: Link test before auto-enabling libusb library Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 4/9] configure: Link test before auto-enabling libusbredir library Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 5/9] configure: Link test before auto-enabling PulseAudio library Philippe Mathieu-Daudé
2019-06-14 10:07 ` Philippe Mathieu-Daudé [this message]
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 7/9] configure: Link test before auto-enabling GTK libraries Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 8/9] tests/docker: Kludge for missing libunistring.so symlink on Ubuntu 18.04 Philippe Mathieu-Daudé
2019-06-14 10:07 ` [Qemu-devel] [PATCH v2 9/9] .travis.yml: Test softmmu static linking Philippe Mathieu-Daudé
2019-07-01 14:08 ` [Qemu-trivial] [PATCH v2 0/9] configure: Fix softmmu --static linking Philippe Mathieu-Daudé
2019-07-01 14:08 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-07-01 14:36 ` Daniel P. Berrangé
2019-07-01 14:43 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190614100718.14019-7-philmd@redhat.com \
--to=philmd@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=bharata@linux.ibm.com \
--cc=fam@euphon.net \
--cc=kraxel@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=ndevos@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.