diff options
-rwxr-xr-x | configure | 15 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rw-r--r-- | debian/rules | 5 | ||||
-rw-r--r-- | include/qemu/qtree.h | 6 | ||||
-rw-r--r-- | meson.build | 6 | ||||
-rw-r--r-- | util/meson.build | 2 |
6 files changed, 25 insertions, 11 deletions
@@ -246,6 +246,7 @@ stack_protector="" safe_stack="" use_containers="yes" gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb") +glib_has_gslice="no" if test -e "$source_path/.git" then @@ -3483,6 +3484,17 @@ for i in $glib_modules; do fi done +# Check whether glib has gslice, which we have to avoid for correctness. +# TODO: remove this check and the corresponding workaround (qtree) when +# the minimum supported glib is >= $glib_dropped_gslice_version. +glib_dropped_gslice_version=2.75.3 +for i in $glib_modules; do + if ! $pkg_config --atleast-version=$glib_dropped_gslice_version $i; then + glib_has_gslice="yes" + break + fi +done + # This workaround is required due to a bug in pkg-config file for glib as it # doesn't define GLIB_STATIC_COMPILATION for pkg-config --static @@ -6753,6 +6765,9 @@ echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak echo "GLIB_LIBS=$glib_libs" >> $config_host_mak +if test "$glib_has_gslice" = "yes" ; then + echo "HAVE_GLIB_WITH_SLICE_ALLOCATOR=y" >> $config_host_mak +fi echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak echo "EXESUF=$EXESUF" >> $config_host_mak diff --git a/debian/control b/debian/control index 942bcb9b4..817e3660c 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: extra Maintainer: Gui Chen <gui.chen@intel.com> Homepage: http://wiki.qemu.org/Index.html Standards-Version: 3.7.0 -Build-Depends: debhelper (>= 4.0.0), dpatch, pkg-config, libglib2.0-dev, python3:any, ninja-build, meson +Build-Depends: debhelper (>= 4.0.0), pkg-config, libglib2.0-dev, python3:any, ninja-build, meson Package: qemu-arm-static Architecture: i386 amd64 diff --git a/debian/rules b/debian/rules index ec57f7e01..c496bbe28 100644 --- a/debian/rules +++ b/debian/rules @@ -3,11 +3,10 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -include /usr/share/dpatch/dpatch.make unexport LDFLAGS build: build-stamp -build-stamp: patch-stamp +build-stamp: dh_testdir ./configure \ --prefix=/usr \ @@ -69,7 +68,7 @@ build-stamp: patch-stamp --disable-xkbcommon dh_auto_build -clean: unpatch +clean: dh_testdir dh_testroot rm -f build-stamp diff --git a/include/qemu/qtree.h b/include/qemu/qtree.h index 156aac449..d65f35350 100644 --- a/include/qemu/qtree.h +++ b/include/qemu/qtree.h @@ -44,12 +44,6 @@ #include "qemu/osdep.h" -#if GLIB_CHECK_VERSION(2,75,3) -// USE GTree -#else -#define HAVE_GLIB_WITH_SLICE_ALLOCATOR -#endif - #ifdef HAVE_GLIB_WITH_SLICE_ALLOCATOR typedef struct _QTree QTree; diff --git a/meson.build b/meson.build index a4743a83a..cb0ff1303 100644 --- a/meson.build +++ b/meson.build @@ -269,6 +269,12 @@ endif add_project_arguments(config_host['GLIB_CFLAGS'].split(), native: false, language: ['c', 'cpp', 'objc']) glib = declare_dependency(link_args: config_host['GLIB_LIBS'].split()) + +# pass down whether Glib has the slice allocator +if config_host.has_key('HAVE_GLIB_WITH_SLICE_ALLOCATOR') + config_host_data.set('HAVE_GLIB_WITH_SLICE_ALLOCATOR', true) +endif + gio = not_found if 'CONFIG_GIO' in config_host gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(), diff --git a/util/meson.build b/util/meson.build index 42ad3049f..39ae83b1d 100644 --- a/util/meson.build +++ b/util/meson.build @@ -17,7 +17,7 @@ util_ss.add(when: 'CONFIG_WIN32', if_true: files('event_notifier-win32.c')) util_ss.add(when: 'CONFIG_WIN32', if_true: files('oslib-win32.c')) util_ss.add(when: 'CONFIG_WIN32', if_true: files('qemu-thread-win32.c')) util_ss.add(when: 'CONFIG_WIN32', if_true: winmm) -util_ss.add(files('qtree.c')) +util_ss.add(when: 'HAVE_GLIB_WITH_SLICE_ALLOCATOR', if_true: files('qtree.c')) util_ss.add(files('envlist.c', 'path.c', 'module.c')) util_ss.add(files('host-utils.c')) util_ss.add(files('bitmap.c', 'bitops.c')) |