[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] configure: Test that gio libs from pkg-config work
From: |
Peter Maydell |
Subject: |
[PATCH] configure: Test that gio libs from pkg-config work |
Date: |
Mon, 12 Oct 2020 16:33:30 +0100 |
On some hosts (eg Ubuntu Bionic) pkg-config returns a set of
libraries for gio-2.0 which don't actually work when compiling
statically. (Specifically, the returned library string includes
-lmount, but not -lblkid which -lmount depends upon, so linking
fails due to missing symbols.)
Check that the libraries work, and don't enable gio if they don't,
in the same way we do for gnutls.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
I wanted a statically-linked system emulation binary (which, yes,
I know is not really something we support :-)). I got one with
suitably liberal use of --disable-foo configure options, and
this was the only thing I couldn't work around that way.
The patch is needed because there's no --disable-gio. I suppose
we could add that instead (or as well)...
Possibly meson offers a nicer way to do this, but this was
simple and gnutls is doing the check this way already.
---
configure | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index e8e8e984f24..cd79227d763 100755
--- a/configure
+++ b/configure
@@ -3762,13 +3762,21 @@ if test "$static" = yes && test "$mingw32" = yes; then
fi
if $pkg_config --atleast-version=$glib_req_ver gio-2.0; then
- gio=yes
gio_cflags=$($pkg_config --cflags gio-2.0)
gio_libs=$($pkg_config --libs gio-2.0)
gdbus_codegen=$($pkg_config --variable=gdbus_codegen gio-2.0)
if [ ! -x "$gdbus_codegen" ]; then
gdbus_codegen=
fi
+ # Check that the libraries actually work -- Ubuntu 18.04 ships
+ # with pkg-config --static --libs data for gio-2.0 that is missing
+ # -lblkid and will give a link error.
+ write_c_skeleton
+ if compile_prog "" "gio_libs" ; then
+ gio=yes
+ else
+ gio=no
+ fi
else
gio=no
fi
--
2.20.1
- Re: [PATCH] Deprecate TileGX port, (continued)
- [PATCH for-5.1] Makefile: Remove config-devices.mak on "make clean", Peter Maydell, 2020/10/12
- [PATCH] Deprecate lm32 port, Peter Maydell, 2020/10/12
- [PATCH] Deprecate Unicore32 port, Peter Maydell, 2020/10/12
- [PATCH RISU] arm.risu, thumb.risu: Add v8.2 DP and FHM insns, Peter Maydell, 2020/10/12
- [PATCH RISU] arm.risu: Add patterns for fp16 insns, Peter Maydell, 2020/10/12
- [PATCH 01/10] decodetree: Fix codegen for non-overlapping group inside overlapping group, Peter Maydell, 2020/10/12
- [PATCH for-5.1] docs/system/arm/virt: Document mte machine option, Peter Maydell, 2020/10/12
- [PATCH] configure: Test that gio libs from pkg-config work,
Peter Maydell <=
- [PATCH for-5.1] hw/arm/armsse: Assert info->num_cpus is in-bounds in armsse_realize(), Peter Maydell, 2020/10/12
- [PATCH for-5.1] hw/arm/netduino2, netduinoplus2: Set system_clock_scale, Peter Maydell, 2020/10/12
[PATCH for-5.1] hw/arm/nrf51_soc: Set system_clock_scale, Peter Maydell, 2020/10/12
[PATCH] hw/arm/mps2: New board model mps2-386, Peter Maydell, 2020/10/12
[PATCH] hw/display/bcm2835_fb.c: Initialize all fields of struct, Peter Maydell, 2020/10/12
[PATCH] hw/intc/arm_gicv3_cpuif: Don't copy CPU's maintenance interrupt, Peter Maydell, 2020/10/12