summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOneric <oneric@oneric.stub>2021-03-24 00:17:27 +0100
committerOneric <oneric@oneric.stub>2021-03-26 00:21:40 +0100
commit11493fbde283dc712cc45df9ceb209a1833c9a7f (patch)
tree1ddbe3b02c1315c1c5b4877cbeebd11438896f86
parent686bfe62eb83e6b55870bde0c726ce34bfb73a85 (diff)
downloadlibass-11493fbde283dc712cc45df9ceb209a1833c9a7f.tar.bz2
libass-11493fbde283dc712cc45df9ceb209a1833c9a7f.tar.xz
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.
-rw-r--r--configure.ac18
-rw-r--r--libass/ass_render.c4
2 files changed, 21 insertions, 1 deletions
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])])
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 2051cfd..ef1e654 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -24,6 +24,7 @@
#include <string.h>
#include <stdbool.h>
+#include "ass.h"
#include "ass_outline.h"
#include "ass_render.h"
#include "ass_parse.h"
@@ -50,6 +51,9 @@ ASS_Renderer *ass_renderer_init(ASS_Library *library)
ASS_Renderer *priv = 0;
int vmajor, vminor, vpatch;
+ ass_msg(library, MSGL_INFO, "libass API version: 0x%X", LIBASS_VERSION);
+ ass_msg(library, MSGL_INFO, "libass source: %s", CONFIG_SOURCEVERSION);
+
error = FT_Init_FreeType(&ft);
if (error) {
ass_msg(library, MSGL_FATAL, "%s failed", "FT_Init_FreeType");