summaryrefslogtreecommitdiffstats
path: root/bin/h5vers
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2016-03-07 22:03:57 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2016-03-07 22:03:57 (GMT)
commit2c36685010638e6bfcdd4ec74194cd200081668b (patch)
tree2f8a2d904c2bdcfeccf97f17f9ea2cec5f9ada52 /bin/h5vers
parentb99b5d494e4aa86901d7a68d4a31de96d11c83c7 (diff)
downloadhdf5-2c36685010638e6bfcdd4ec74194cd200081668b.zip
hdf5-2c36685010638e6bfcdd4ec74194cd200081668b.tar.gz
hdf5-2c36685010638e6bfcdd4ec74194cd200081668b.tar.bz2
[svn-r29326] HDFFV-9536: Changed H5check_version() to use libtool shared library version numbers instead of the library version numbers.
bin/h5vers: Changed to copy the shared lib version from lt_vers.am to H5public.h (Thanks to Larry who made the changes.) config/lt_vers.am: cosmetic change, nothing material. src/H5public.h: Changed by bin/h5vers. src/H5.c: Changed H5check_version() to use shared library version for compatibility checking. test/tcheck_version.c: test/testcheck_version.sh.in: Changed to use shared library version numbers instead of the HDF5 library version numbers for testing. Tested: tested in Jam (C only), platypus and osx1010dev (enable fortran and C++).
Diffstat (limited to 'bin/h5vers')
-rwxr-xr-xbin/h5vers60
1 files changed, 40 insertions, 20 deletions
diff --git a/bin/h5vers b/bin/h5vers
index 7e61dc8..9a0fa59 100755
--- a/bin/h5vers
+++ b/bin/h5vers
@@ -105,6 +105,13 @@ sub setvers {
$vers[3]?"-":"", $vers[3])/me;
}
+sub setltvers {
+ my ($contents, @vers) = @_;
+ $_[0] =~ s/^(\#\s*define\s+LT_VERS_INTERFACE\s+)\d+/$1$vers[0]/m;
+ $_[0] =~ s/^(\#\s*define\s+LT_VERS_REVISION\s+)\d+/$1$vers[1]/m;
+ $_[0] =~ s/^(\#\s*define\s+LT_VERS_AGE\s+)\d+/$1$vers[2]/m;
+}
+
sub usage {
my ($prog) = $0 =~ /([^\/]+)$/;
print STDERR <<EOF;
@@ -239,7 +246,7 @@ if ($set) {
$RELEASE = "";
$CONFIGURE = "";
$CPP_DOC_CONFIG = "";
- $LT_VERS = "";
+# $LT_VERS = "";
@newver = @curver;
}
@@ -256,35 +263,45 @@ if ($newver[0]*1000000 + $newver[1]*1000 + $newver[2] >
$version_increased="true";
}
+my @newltver;
+# Update the libtool shared library version in src/H5public.h
+if ($LT_VERS) {
+ open FILE, $LT_VERS or die "$LT_VERS: $!\n";
+ my ($contentsy) = join "", <FILE>;
+ close FILE;
+
+ local($_) = $contentsy;
+
+ # Don't increment LT_VERS_REVISION, but instead copy LT_VERS_* values
+ # to H5public.h.
+ # my ($lt_revision) = /^LT_VERS_REVISION\s*=\s*(\d+)/m;
+ # my $new_lt_revision = $lt_revision+1;
+ # ($contentsy) =~ s/^(LT_VERS_REVISION\s*=\s*)\d+/$1$new_lt_revision/m;
+
+ # open FILE, ">$LT_VERS" or die "$LT_VERS: $!\n";
+ # print FILE $contentsy;
+ # close FILE;
+
+ my ($lt_interface) = /^LT_VERS_INTERFACE\s*=\s*(\d+)/m;
+ my ($lt_revision) = /^LT_VERS_REVISION\s*=\s*(\d+)/m;
+ my ($lt_age) = /^LT_VERS_AGE\s*=\s*(\d+)/m;
+
+ @newltver = ($lt_interface, $lt_revision, $lt_age);
+
+}
+
# Update the version number if it changed.
if ($newver[0]!=$curver[0] ||
$newver[1]!=$curver[1] ||
$newver[2]!=$curver[2] ||
$newver[3]ne$curver[3]) {
setvers $contents, @newver or die "unable to set version\n";
+}
+ setltvers $contents, @newltver or die "unable to set lt version\n";
rename $file, "$file~" or die "unable to save backup file\n";
open FILE, ">$file" or die "unable to open $file but backup saved!\n";
print FILE $contents;
close FILE;
-}
-
-# Update the libtool shared library version in src/Makefile.am if
-# the version number has increased.
-if ($LT_VERS && $version_increased) {
- open FILE, $LT_VERS or die "$LT_VERS: $!\n";
- my ($contentsy) = join "", <FILE>;
- close FILE;
-
- local($_) = $contentsy;
-
- my ($lt_revision) = /^LT_VERS_REVISION\s*=\s*(\d+)/m;
- my $new_lt_revision = $lt_revision+1;
- ($contentsy) =~ s/^(LT_VERS_REVISION\s*=\s*)\d+/$1$new_lt_revision/m;
-
- open FILE, ">$LT_VERS" or die "$LT_VERS: $!\n";
- print FILE $contentsy;
- close FILE;
-}
# Update the README.txt file
if ($README) {
@@ -436,6 +453,9 @@ if ($verbose) {
$newver[3] eq "" ? "" : "-".$newver[3]);
}
+# print shared lib version in the format of interface.revision.age
+printf("Shared lib version %d.%d.%d\n", @newltver[0,1,2]);
+
exit 0;
# Because the first line of this file looks like a Bourne shell script, we