From 065a8a488ad2ee4a7523fb673e1555e5cf8762b5 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 14 Jul 2017 13:56:02 +0100 Subject: [PATCH] meson: Use the appropriate interface and binary ages We need to build them out of the project version, and then propagate them. --- glib/tests/meson.build | 2 +- gobject/tests/meson.build | 2 +- meson.build | 15 +++++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/glib/tests/meson.build b/glib/tests/meson.build index 8b9a889d5..6b7e323d1 100644 --- a/glib/tests/meson.build +++ b/glib/tests/meson.build @@ -86,7 +86,7 @@ endif # FIXME: use new environment() object # Not entirely random of course, but at least it changes over time -random_number = minor_version.to_int() + meson.version().split('.').get(1).to_int() +random_number = minor_version + meson.version().split('.').get(1).to_int() test_env = [ 'G_TEST_SRCDIR=' + meson.current_source_dir(), diff --git a/gobject/tests/meson.build b/gobject/tests/meson.build index 69d4facb5..38002f299 100644 --- a/gobject/tests/meson.build +++ b/gobject/tests/meson.build @@ -20,7 +20,7 @@ gobject_tests = [ # FIXME: use new environment() object # FIXME: put common bits of test environment() in one location # Not entirely random of course, but at least it changes over time -random_number = minor_version.to_int() + meson.version().split('.').get(1).to_int() +random_number = minor_version + meson.version().split('.').get(1).to_int() test_env = [ 'G_TEST_SRCDIR=' + meson.current_source_dir(), diff --git a/meson.build b/meson.build index 65c44316b..55ad7983b 100644 --- a/meson.build +++ b/meson.build @@ -30,14 +30,17 @@ host_system = host_machine.system() glib_version = meson.project_version() glib_api_version = '2.0' version_arr = glib_version.split('.') -major_version = version_arr[0] -minor_version = version_arr[1] -micro_version = version_arr[2] +major_version = version_arr[0].to_int() +minor_version = version_arr[1].to_int() +micro_version = version_arr[2].to_int() + +interface_age = minor_version.is_odd() ? 0 : micro_version +binary_age = 100 * minor_version + micro_version soversion = 0 # Maintain compatibility with previous libtool versioning # current = minor * 100 + micro -library_version = '@0@.@1@.@2@'.format(soversion, minor_version.to_int() * 100, micro_version.to_int()) +library_version = '@0@.@1@.@2@'.format(soversion, binary_age - interface_age, interface_age) configinc = include_directories('.') glibinc = include_directories('glib') @@ -68,8 +71,8 @@ glib_conf.set('GLIB_VERSION', glib_version) glib_conf.set('GLIB_MAJOR_VERSION', major_version) glib_conf.set('GLIB_MINOR_VERSION', minor_version) glib_conf.set('GLIB_MICRO_VERSION', micro_version) -glib_conf.set('GLIB_INTERFACE_AGE', micro_version) -glib_conf.set('GLIB_BINARY_AGE', 100 * minor_version.to_int() + micro_version.to_int()) +glib_conf.set('GLIB_INTERFACE_AGE', interface_age) +glib_conf.set('GLIB_BINARY_AGE', binary_age) glib_conf.set_quoted('GETTEXT_PACKAGE', 'glib20') glib_conf.set_quoted('PACKAGE_BUGREPORT', 'http://bugzilla.gnome.org/enter_bug.cgi?product=glib') glib_conf.set_quoted('PACKAGE_NAME', 'glib')