From 11493fbde283dc712cc45df9ceb209a1833c9a7f Mon Sep 17 00:00:00 2001 From: Oneric Date: Wed, 24 Mar 2021 00:17:27 +0100 Subject: Print libass version This could help us in future bug reports and we already do so for shapers and freetype. Also include a guess about the source code version, which may not be entirely reliable. Eg if custom tarballs are involved or if patches are added after configure was called, the value will be wrong. But hopefully it will be "good enough" for most cases. --- configure.ac | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 6cb4948..38d4c23 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,5 @@ -AC_INIT(libass, 0.15.0) +m4_define([LIBASS_VERSION], [0.15.0]) +AC_INIT(libass, LIBASS_VERSION) AM_INIT_AUTOMAKE([foreign]) AC_CONFIG_MACRO_DIR([m4]) # Disable Fortran checks @@ -301,6 +302,21 @@ AM_COND_IF([ENABLE_LARGE_TILES], [ AC_DEFINE(CONFIG_LARGE_TILES, 0, [use small tiles]) ]) +## Make a guess about the source code version +AS_IF([test -d "${srcdir}/.git"], [ + AC_PATH_PROG([git_bin], [git]) + AS_IF([test -n "$git_bin"], [ + srcversion_string="commit: $("$git_bin" -C "$srcdir" describe --tags --long --always --dirty --broken --abbrev=40)" + ], [ + srcversion_string="custom after: LIBASS_VERSION" + ]) +], [ + dnl# Hope no one creates custom tarballs without adjusting the version + srcversion_string="tarball: LIBASS_VERSION" +]) +AC_DEFINE_UNQUOTED([CONFIG_SOURCEVERSION], ["$srcversion_string"], + [string containing info about the used source]) + ## Setup output beautifier. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -- cgit v1.2.3