-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libostree: add versioning macros #728
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
AC_PREREQ([2.63]) | ||
dnl If incrementing the version here, remember to update libostree.sym too | ||
AC_INIT([libostree], [2017.3], [[email protected]]) | ||
m4_define([year_version], [2017]) | ||
m4_define([release_version], [3]) | ||
m4_define([package_version], [year_version.release_version]) | ||
|
||
AC_INIT([libostree], [package_version], [[email protected]]) | ||
AC_CONFIG_HEADER([config.h]) | ||
AC_CONFIG_MACRO_DIR([buildutil]) | ||
AC_CONFIG_AUX_DIR([build-aux]) | ||
|
@@ -16,6 +20,11 @@ AC_PROG_CC | |
AM_PROG_CC_C_O | ||
AC_PROG_YACC | ||
|
||
dnl Versioning information | ||
AC_SUBST([YEAR_VERSION], [year_version]) | ||
AC_SUBST([RELEASE_VERSION], [release_version]) | ||
AC_SUBST([PACKAGE_VERSION], [package_version]) | ||
|
||
CC_CHECK_FLAGS_APPEND([WARN_CFLAGS], [CFLAGS], [\ | ||
-pipe \ | ||
-Wall \ | ||
|
@@ -398,6 +407,7 @@ AC_CONFIG_FILES([ | |
Makefile | ||
apidoc/Makefile | ||
src/libostree/ostree-1.pc | ||
src/libostree/ostree-version.h | ||
]) | ||
AC_OUTPUT | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- | ||
* | ||
* Copyright (C) 2017 Georges Basile Stavracas Neto <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published | ||
* by the Free Software Foundation; either version 2 of the licence or (at | ||
* your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General | ||
* Public License along with this library; if not, write to the | ||
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, | ||
* Boston, MA 02111-1307, USA. | ||
*/ | ||
|
||
#pragma once | ||
|
||
/** | ||
* SECTION:ostree-version | ||
* @short_description: ostree version checking | ||
* | ||
* ostree provides macros to check the version of the library | ||
* at compile-time | ||
*/ | ||
|
||
/** | ||
* OSTREE_YEAR_VERSION: | ||
* | ||
* ostree year version component (e.g. 2017 if %OSTREE_VERSION is 2017.2) | ||
*/ | ||
#define OSTREE_YEAR_VERSION (@YEAR_VERSION@) | ||
|
||
/** | ||
* OSTREE_RELEASE_VERSION: | ||
* | ||
* ostree release version component (e.g. 2 if %OSTREE_VERSION is 2017.2) | ||
*/ | ||
#define OSTREE_RELEASE_VERSION (@RELEASE_VERSION@) | ||
|
||
/** | ||
* OSTREE_VERSION | ||
* | ||
* ostree version. | ||
*/ | ||
#define OSTREE_VERSION (@VERSION@) | ||
|
||
/** | ||
* OSTREE_VERSION_S: | ||
* | ||
* ostree version, encoded as a string, useful for printing and | ||
* concatenation. | ||
*/ | ||
#define OSTREE_VERSION_S "@VERSION@" | ||
|
||
#define OSTREE_ENCODE_VERSION(year,release) \ | ||
((year) << 16 | (release)) | ||
|
||
/** | ||
* OSTREE_VERSION_HEX: | ||
* | ||
* ostree version, encoded as an hexadecimal number, useful for | ||
* integer comparisons. | ||
*/ | ||
#define OSTREE_VERSION_HEX \ | ||
(OSTREE_ENCODE_VERSION (OSTREE_YEAR_VERSION, OSTREE_RELEASE_VERSION)) | ||
|
||
/** | ||
* OSTREE_CHECK_VERSION: | ||
* @year: required year version | ||
* @release: required release version | ||
* | ||
* Compile-time version checking. Evaluates to %TRUE if the version | ||
* of ostree is equal or greater than the required one. | ||
*/ | ||
#define OSTREE_CHECK_VERSION(year,release) \ | ||
(OSTREE_YEAR_VERSION >= (year) || \ | ||
(OSTREE_YEAR_VERSION == (year) && OSTREE_RELEASE_VERSION >= (release))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,4 @@ | |
#include <ostree-gpg-verify-result.h> | ||
|
||
#include <ostree-autocleanups.h> | ||
#include <ostree-version.h> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this information be exported with a function so that it is evaluated after the library is loaded? Otherwise, IMHO, it adds not much more value than
pkg-config --modversion