From d3d14fd4a203d6233e8174def870fa8ff44e95f4 Mon Sep 17 00:00:00 2001 From: Mattias Hansson Date: Thu, 30 Sep 2021 10:41:01 +0200 Subject: [PATCH] pkg.m4.in: PKG_CHECK_MODULES provides modversion Projects using PKG_CHECK_MODULES wants to add compilation information to their binaries, as part of the compilation information the projects wants to disclose dependency versions. Currently, the projects have to resolve dependency versions themselves when using pkg-config. With this patch PKG_CHECK_MODULES now defines a $PKG_VERSION variable that represents `--modversion`. --- pkg.m4.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg.m4.in b/pkg.m4.in index c183d8e..5f5182d 100644 --- a/pkg.m4.in +++ b/pkg.m4.in @@ -146,6 +146,7 @@ AC_MSG_CHECKING([for $2]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) +_PKG_CONFIG([$1][_VERSION], [modversion], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. @@ -186,6 +187,7 @@ To get pkg-config, see .])[]dnl else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + $1[]_VERSION=$pkg_cv_[]$1[]_VERSION AC_MSG_RESULT([yes]) $3 fi[]dnl