From c33543f5cafcc261d926e6bf1f4837ada883f455 Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Fri, 19 Apr 2019 10:15:06 +0200 Subject: [PATCH] configure.ac,meson: Define GLIB_VERSION_{MIN_REQUIRED,MAX_ALLOWED} Signed-off-by: Quentin Glidic --- configure.ac | 7 ++++++- meson.build | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 7ab3d273..01d2b494 100644 --- a/configure.ac +++ b/configure.ac @@ -120,8 +120,13 @@ PKG_PROG_PKG_CONFIG dnl --------------------------------------------------------------------- dnl PKG_CONFIG based dependencies dnl --------------------------------------------------------------------- +glib_min_major="2" +glib_min_minor="40" +glib_min_version="${glib_min_major}.${glib_min_minor}" NK_INIT([bindings xdg-theme]) -PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.40 gio-unix-2.0 gmodule-2.0]) +PKG_CHECK_MODULES([glib], [glib-2.0 >= ${glib_min_version} gio-unix-2.0 gmodule-2.0]) +AC_DEFINE_UNQUOTED([GLIB_VERSION_MIN_REQUIRED], [(G_ENCODE_VERSION(${glib_min_major},${glib_min_minor}))], [The lower GLib version supported]) +AC_DEFINE_UNQUOTED([GLIB_VERSION_MAX_ALLOWED], [(G_ENCODE_VERSION(${glib_min_major},${glib_min_minor}))], [The highest GLib version supported]) GW_CHECK_XCB([xcb-aux xcb-xkb xkbcommon xkbcommon-x11 xcb-ewmh xcb-icccm xcb-xrm xcb-randr xcb-xinerama]) PKG_CHECK_MODULES([pango], [pango pangocairo]) PKG_CHECK_MODULES([cairo], [cairo cairo-xcb]) diff --git a/meson.build b/meson.build index 087cd300..cb350729 100644 --- a/meson.build +++ b/meson.build @@ -31,8 +31,11 @@ endforeach plugindir = join_paths(get_option('libdir'), meson.project_name()) themedir = join_paths(get_option('datadir'), meson.project_name(), 'themes') +glib_min_major=2 +glib_min_minor=40 +glib_min_version='@0@.@1@'.format(glib_min_major, glib_min_minor) plugins_deps = [ - dependency('glib-2.0', version: '>= 2.40'), + dependency('glib-2.0', version: '>= @0@'.format(glib_min_version)), dependency('gmodule-2.0'), dependency('cairo'), ] @@ -77,6 +80,9 @@ header_conf.set('_GNU_SOURCE', true) header_conf.set('USE_NK_GIT_VERSION', true) +header_conf.set('GLIB_VERSION_MIN_REQUIRED', '(G_ENCODE_VERSION(@0@,@1@))'.format(glib_min_major, glib_min_minor)) +header_conf.set('GLIB_VERSION_MAX_ALLOWED', '(G_ENCODE_VERSION(@0@,@1@))'.format(glib_min_major, glib_min_minor)) + header_conf.set('ENABLE_DRUN', get_option('drun')) header_conf.set('WINDOW_MODE', get_option('window')) header_conf.set('TIMINGS', get_option('timings'))