Export the shared library version, not just the package version.

This commit is contained in:
Frank Denis 2013-03-31 15:22:43 -07:00
parent 5f3104cf5f
commit e59ed29ee8
4 changed files with 15 additions and 10 deletions

View File

@ -61,11 +61,11 @@ as `crypto_sign_edwards25519sha512batch*`.
## Additional features
The Sodium library provides some convenience functions in order to retrieve
the current version of the library:
the current version of the package and of the shared library:
const char *sodium_version_string(void);
const int sodium_version_major(void);
const int sodium_version_minor(void);
const int sodium_library_version_major(void);
const int sodium_library_version_minor(void);
Headers are installed in `${prefix}/include/sodium`.

View File

@ -13,7 +13,10 @@ AC_SUBST(VERSION)
ISODATE=`date +%Y-%m-%d`
AC_SUBST(ISODATE)
SODIUM_LIBRARY_VERSION=3:1:0
SODIUM_LIBRARY_VERSION_MAJOR=4
SODIUM_LIBRARY_VERSION_MINOR=0
SODIUM_LIBRARY_VERSION=4:0:0
# | | |
# +------+ | +---+
# | | |
@ -25,6 +28,8 @@ SODIUM_LIBRARY_VERSION=3:1:0
# | +- increment if source code has changed
# | set to zero if current is incremented
# +- increment if interfaces have been added, removed or changed
AC_SUBST(SODIUM_LIBRARY_VERSION_MAJOR)
AC_SUBST(SODIUM_LIBRARY_VERSION_MINOR)
AC_SUBST(SODIUM_LIBRARY_VERSION)
LX_CFLAGS=${CFLAGS-NONE}

View File

@ -4,16 +4,16 @@
#define SODIUM_VERSION_STRING "@VERSION@"
#define SODIUM_VERSION_MAJOR 0
#define SODIUM_VERSION_MINOR 4
#define SODIUM_LIBRARY_VERSION_MAJOR @SODIUM_LIBRARY_VERSION_MAJOR@
#define SODIUM_LIBRARY_VERSION_MINOR @SODIUM_LIBRARY_VERSION_MINOR@
#ifdef __cplusplus
extern "C" {
#endif
const char *sodium_version_string(void);
int sodium_version_major(void);
int sodium_version_minor(void);
int sodium_library_version_major(void);
int sodium_library_version_minor(void);
#ifdef __cplusplus
}

View File

@ -10,11 +10,11 @@ sodium_version_string(void)
int
sodium_version_major(void)
{
return SODIUM_VERSION_MAJOR;
return SODIUM_LIBRARY_VERSION_MAJOR;
}
int
sodium_version_minor(void)
{
return SODIUM_VERSION_MINOR;
return SODIUM_LIBRARY_VERSION_MINOR;
}