blkid: split SONAME and LIBBLKID_VERSION
It seems better to split SONAME and the public library version. The
library version will be the same as util-linux-ng PACKAGE_VERSION.
PACKAGE_VERSION: <maj>.<min>[-<suffix>] e.g. 2.15-rc2
Symbols versioning: BLKID_<maj>.<min> e.g. BLKID_2.15
blkid_get_library_version(): <maj>.<min>.0 e.g. 2.15.0
SONAME: libblkid.so.1
See also the original patch a0487b1cb5
where was introduced library versioning.
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
279723e92d
commit
33b0be6d60
27
configure.ac
27
configure.ac
|
@ -11,16 +11,15 @@ AC_CONFIG_SRCDIR(mount/mount.c)
|
|||
|
||||
AC_PREFIX_DEFAULT([/usr])
|
||||
|
||||
dnl blkid version definition (the library SONAME is
|
||||
dnl "libblkid.so.$BLKID_VERSION_MAJOR", see blkid/Makefile.am)
|
||||
dnl ----------------------------------------------------------
|
||||
BLKID_VERSION_MAJOR=1
|
||||
BLKID_VERSION_MINOR=99
|
||||
BLKID_VERSION_RELEASE=0
|
||||
BLKID_DATE="10-Feb-2009"
|
||||
dnl version details from <major>.<minor>[-<suffix>]
|
||||
PACKAGE_VERSION_MAJOR=$(echo $PACKAGE_VERSION | awk -F. '{print $1}')
|
||||
PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{print $2}' \
|
||||
| awk -F- '{print $1}')
|
||||
PACKAGE_VERSION_RELEASE=0
|
||||
|
||||
BLKID_VERSION=$BLKID_VERSION_MAJOR.$BLKID_VERSION_MINOR.$BLKID_VERSION_RELEASE
|
||||
BLKID_VERSION_INFO=`expr $BLKID_VERSION_MAJOR + $BLKID_VERSION_MINOR`:$BLKID_VERSION_RELEASE:$BLKID_VERSION_MINOR
|
||||
dnl libblkid version
|
||||
LIBBLKID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
|
||||
LIBBLKID_DATE="10-Feb-2009"
|
||||
|
||||
# Check whether exec_prefix=/usr:
|
||||
case $exec_prefix:$prefix in
|
||||
|
@ -188,13 +187,9 @@ elif test "x$with_fsprobe" = xbuiltin; then
|
|||
have_blkid=yes
|
||||
build_libblkid=yes
|
||||
have_blkid_evaluate=yes
|
||||
AC_SUBST(BLKID_VERSION_MAJOR)
|
||||
AC_SUBST(BLKID_VERSION_MINOR)
|
||||
AC_SUBST(BLKID_VERSION_RELEASE)
|
||||
AC_SUBST(BLKID_VERSION)
|
||||
AC_SUBST(BLKID_VERSION_INFO)
|
||||
AC_DEFINE_UNQUOTED(BLKID_VERSION, "$BLKID_VERSION", [libblkid version string])
|
||||
AC_DEFINE_UNQUOTED(BLKID_DATE, "$BLKID_DATE", [libblkid date string])
|
||||
AC_SUBST(LIBBLKID_VERSION)
|
||||
AC_DEFINE_UNQUOTED(LIBBLKID_VERSION, "$LIBBLKID_VERSION", [libblkid version string])
|
||||
AC_DEFINE_UNQUOTED(LIBBLKID_DATE, "$LIBBLKID_DATE", [libblkid date string])
|
||||
fi
|
||||
|
||||
if test "x$have_blkid" = xyes; then
|
||||
|
|
|
@ -45,7 +45,7 @@ const char *progname = "blkid";
|
|||
static void print_version(FILE *out)
|
||||
{
|
||||
fprintf(out, "%s from %s (libblkid %s, %s)\n",
|
||||
progname, PACKAGE_STRING, BLKID_VERSION, BLKID_DATE);
|
||||
progname, PACKAGE_STRING, LIBBLKID_VERSION, LIBBLKID_DATE);
|
||||
}
|
||||
|
||||
static void usage(int error)
|
||||
|
|
|
@ -5,7 +5,7 @@ includedir=@includedir@
|
|||
|
||||
Name: blkid
|
||||
Description: Block device id library
|
||||
Version: @BLKID_VERSION@
|
||||
Version: @LIBBLKID_VERSION@
|
||||
Requires.private: uuid
|
||||
Cflags: -I${includedir}/blkid
|
||||
Libs: -L${libdir} -lblkid
|
||||
|
|
|
@ -29,9 +29,9 @@ libblkid_la_LIBADD = probers/libblkid_probers.la $(common_ldadd)
|
|||
libblkid_la_DEPENDENCIES = $(libblkid_la_LIBADD) blkid.sym
|
||||
|
||||
# TODO: for unknown reason "make distcheck" requires
|
||||
# full path to the version string
|
||||
# full path to the version script
|
||||
libblkid_la_LDFLAGS = -Wl,--version-script=$(top_srcdir)/libs/blkid/src/blkid.sym \
|
||||
-version-info @BLKID_VERSION_INFO@
|
||||
-version-info 1:0:0
|
||||
|
||||
tests = test_cache test_config test_dev test_devname test_devno test_getsize \
|
||||
test_read test_resolve test_save test_tag test_verify test_evaluate
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* can't run with old libblkid.so not providing foo() - the global SONAME
|
||||
* version info can't enforce this since we never change the SONAME.
|
||||
*
|
||||
* The original libblkid (.so version 1.0) from e2fsprogs does not to use
|
||||
* The original libblkid from e2fsprogs (<=1.41.4) does not to use
|
||||
* symbol versioning -- all the original symbols are in BLKID_1.0 now.
|
||||
*/
|
||||
BLKID_1.0 {
|
||||
|
@ -39,9 +39,9 @@ local:
|
|||
|
||||
|
||||
/*
|
||||
* util-linux-ng version(s)
|
||||
* version(s) since util-linux-ng 2.15
|
||||
*/
|
||||
BLKID_1.42 {
|
||||
BLKID_2.15 {
|
||||
global:
|
||||
blkid_do_probe;
|
||||
blkid_do_safeprobe;
|
||||
|
|
|
@ -18,8 +18,9 @@
|
|||
|
||||
#include "blkid.h"
|
||||
|
||||
static const char *lib_version = BLKID_VERSION;
|
||||
static const char *lib_date = BLKID_DATE;
|
||||
/* LIBBLKID_* defined in the global config.h */
|
||||
static const char *lib_version = LIBBLKID_VERSION; /* release version */
|
||||
static const char *lib_date = LIBBLKID_DATE;
|
||||
|
||||
int blkid_parse_version_string(const char *ver_string)
|
||||
{
|
||||
|
@ -36,6 +37,13 @@ int blkid_parse_version_string(const char *ver_string)
|
|||
return version;
|
||||
}
|
||||
|
||||
/**
|
||||
* blkid_get_library_version:
|
||||
* @ver_string: returns relese version (!= SONAME version)
|
||||
* @date_string: returns date
|
||||
*
|
||||
* Returns release version code.
|
||||
*/
|
||||
int blkid_get_library_version(const char **ver_string,
|
||||
const char **date_string)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue