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'))