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
a0487b1cb5beffb8f6783476664b01e8833e0ea8
where was introduced library versioning.
Signed-off-by: Karel Zak <kzak@redhat.com>
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
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
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)
Name: blkid
Description: Block device id library
-Version: @BLKID_VERSION@
+Version: @LIBBLKID_VERSION@
Requires.private: uuid
Cflags: -I${includedir}/blkid
Libs: -L${libdir} -lblkid
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
* 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 {
/*
- * 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;
#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)
{
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)
{