Add OSTREE_BUILT_FEATURES to ostree-version.h

This way projects can dispatch at run-time based on ostree's
build time options, e.g. detect the availability of GPG.

Closes: #1890
Approved by: jlebon
This commit is contained in:
Colin Walters 2019-07-24 21:31:54 +00:00 committed by Atomic Bot
parent cf7fc0eabb
commit c9ecfb1d81
2 changed files with 13 additions and 0 deletions

View File

@ -584,6 +584,9 @@ OSTREE_FEATURES="$OSTREE_FEATURES $release_build_type"
# P2P API is public in OSTree >= 2018.6
OSTREE_FEATURES="$OSTREE_FEATURES p2p"
# Strip leading whitespace
OSTREE_FEATURES=$(echo ${OSTREE_FEATURES})
AC_CONFIG_FILES([
Makefile
apidoc/Makefile

View File

@ -91,3 +91,13 @@
#define OSTREE_CHECK_VERSION(year,release) \
(OSTREE_YEAR_VERSION > (year) || \
(OSTREE_YEAR_VERSION == (year) && OSTREE_RELEASE_VERSION >= (release)))
/**
* OSTREE_BUILT_FEATURES:
*
* Whitespace separated set of features this libostree was configured with at build time.
* Consult the source code in configure.ac (or the CLI `ostree --version`) for examples.
*
* Since: 2019.3
*/
#define OSTREE_BUILT_FEATURES "@OSTREE_FEATURES@"