]> err.no Git - util-linux/commitdiff
blkid: split SONAME and LIBBLKID_VERSION
authorKarel Zak <kzak@redhat.com>
Tue, 28 Apr 2009 20:51:53 +0000 (22:51 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 28 Apr 2009 21:29:06 +0000 (23:29 +0200)
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>
configure.ac
libs/blkid/bin/blkid.c
libs/blkid/blkid.pc.in
libs/blkid/src/Makefile.am
libs/blkid/src/blkid.sym
libs/blkid/src/version.c

index 017958f7450d7a4522dd7ee949c71cf894e59d51..96244573da51a8da048390aff550436d1bf6c7bc 100644 (file)
@@ -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
index 620344e4bdf5c725c40b481c324489fb944f43b4..72b22c3d1fd39bd839c5916f2044fcca8dd9fd71 100644 (file)
@@ -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)
index 6955750820ec440322fe4999f111bbf2f966d070..5d58c3e1958cc8789e2354bd5ccf00a5b21b2d3e 100644 (file)
@@ -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
index 8c95a47f607767d9b20ac5808c59b5389a1f126d..805d0899b794a78f671853e2d1a359000313b82a 100644 (file)
@@ -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
index e08df0f523e2620aeceb722370fa6f22397d0065..abb8e51f7a402e9f4648024ccec8269a6d16ab01 100644 (file)
@@ -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;
index 5d75e8f633e54ed754b86bf1c7d17d518d909f5b..838af11462ee117df655ae89e0f6a0c5a83ed11a 100644 (file)
@@ -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)
 {