summaryrefslogtreecommitdiffstats
path: root/bin/h5vers
diff options
context:
space:
mode:
authorScott Wegner <swegner@hdfgroup.org>2008-08-06 20:04:37 (GMT)
committerScott Wegner <swegner@hdfgroup.org>2008-08-06 20:04:37 (GMT)
commitdc7d4bc0a76b53f4a082571a4e2bd05574edae49 (patch)
treeea9619677d08b44c94fa04cad279d9303de4dcf0 /bin/h5vers
parenta3d10354eb1f612ae36d48a32372c030fe6981e5 (diff)
downloadhdf5-dc7d4bc0a76b53f4a082571a4e2bd05574edae49.zip
hdf5-dc7d4bc0a76b53f4a082571a4e2bd05574edae49.tar.gz
hdf5-dc7d4bc0a76b53f4a082571a4e2bd05574edae49.tar.bz2
[svn-r15441] Purpose: Backport from trunk: Bring the Windows H5pubconf.h up-to-date
Description: This commit is a major update to the Windows-maintained H5pubconf.h file. This file is statically-distributed because Windows cannot generate it dynamically as other platforms do. Previously, our Windows version contained a minimal subset of the macro definitions required. To update, I've gone through each macro (based on kagiso's output), and tested for the correct value on Windows. This allows us to better target code based on feature flags. It should also be easier to update in the future as changes are made to the configure script. This commit also contains one small bug fix in h5ls.c. Some Windows-specific code was missing a local variable definition. The bug went unnoticed because Windows didn't define the feature flag correctly. I've also made changes to the h5vers script. Whenever the version string is incremented (automatically by h5test after a snapshot), the strings in H5pubconf.h will also be updated. Tested: VS2005 on WinXP (32- and 64-bit) VS.NET on WinXP 32-bit h5vers tested under Cygwin
Diffstat (limited to 'bin/h5vers')
-rwxr-xr-xbin/h5vers54
1 files changed, 51 insertions, 3 deletions
diff --git a/bin/h5vers b/bin/h5vers
index e68a4de..1b41d0f 100755
--- a/bin/h5vers
+++ b/bin/h5vers
@@ -73,6 +73,8 @@ use strict;
# something like: This is hdf5-1.2.3-pre1 currently under development.
# The AC_INIT macro in configure.in will also change in this case to be
# something like: AC_INIT([HDF5], [hdf5-1.2.3-pre1], [help@hdfgroup.org])
+# Version changes are also reflected in the Windows-maintained H5pubconf.h
+# file.
#
# Whenever the version changes, this script will increment the revision
# field in HDF5's libtool shared library version in config/lt_vers.am,
@@ -157,9 +159,10 @@ while ($_ = shift) {
die "mutually exclusive options given\n" if $set && $inc;
# Determine file to use as H5public.h, README.txt,
-# release_docs/RELEASE.txt, configure.in, and config/lt_vers.am. The
-# README.txt, release_docs/RELEASE.txt, configure.in, and
-# config/lt_vers.am files are always in the directory above H5public.h
+# release_docs/RELEASE.txt, configure.in, windows/src/H5pubconf.h,
+# and config/lt_vers.am. The README.txt, release_docs/RELEASE.txt,
+# configure.in, windows/src/H5pubconf.h, and config/lt_vers.am
+# files are always in the directory above H5public.h
unless ($file) {
for (@files) {
($file=$_,last) if -f $_;
@@ -183,6 +186,10 @@ die "unable to read file: $RELEASE\n" unless -r $file;
my $CONFIGURE = $file;
$CONFIGURE =~ s/[^\/]*$/..\/configure.in/;
die "unable to read file: $CONFIGURE\n" unless -r $file;
+# windows/src/H5pubconf.h
+my $H5PUBCONF = $file;
+$H5PUBCONF =~ s/[^\/]*$/..\/windows\/src\/H5pubconf.h/;
+die "unable to read file: $H5PUBCONF\n" unless -r $file;
# Get the current version number.
open FILE, $file or die "unable to open $file: $!\n";
@@ -230,6 +237,7 @@ if ($set) {
$README = "";
$RELEASE = "";
$CONFIGURE = "";
+ $H5PUBCONF = "";
$LT_VERS = "";
@newver = @curver;
}
@@ -341,6 +349,46 @@ sub gen_configure {
# Update the configure.in files and regenerate them
gen_configure("HDF5", $CONFIGURE) if $CONFIGURE;
+sub gen_h5pubconf {
+ my ($name, $pubconf, @vers) = @_;
+
+ my $namelc = lc($name);
+ my $nameuc = uc($name);
+
+ open FILE, $pubconf or die "$pubconf: $!\n";
+ my @contents = <FILE>;
+ close FILE;
+
+ for (my $i = 0; $i < $#contents; ++$i) {
+ if ($contents[$i] =~ /\#\s*define\s+H5_PACKAGE\s+/) {
+ $contents[$i] = "\#define H5_PACKAGE \"$namelc\"\n";
+ } elsif ($contents[$i] =~ /\#\s*define\s+H5_PACKAGE_NAME\s+/) {
+ $contents[$i] = "\#define H5_PACKAGE_NAME \"$nameuc\"\n";
+ } elsif ($contents[$i] =~ /\#\s*define\s+H5_PACKAGE_STRING\s+/) {
+ $contents[$i] = sprintf("\#define H5_PACKAGE_STRING \"$nameuc %d.%d.%d%s\"\n",
+ @vers[0,1,2],
+ $newver[3] eq "" ? "" : "-".$newver[3]);
+ } elsif ($contents[$i] =~ /\#\s*define\s+H5_PACKAGE_TARNAME\s+/) {
+ $contents[$i] = "\#define H5_PACKAGE_TARNAME \"$namelc\"\n";
+ } elsif ($contents[$i] =~ /\#\s*define\s+H5_PACKAGE_VERSION\s+/) {
+ $contents[$i] = sprintf("\#define H5_PACKAGE_VERSION \"%d.%d.%d%s\"\n",
+ @vers[0,1,2],
+ $newver[3] eq "" ? "" : "-".$newver[3]);
+ } elsif ($contents[$i] =~ /\#\s*define\s+H5_VERSION\s+/) {
+ $contents[$i] = sprintf("\#define H5_VERSION \"%d.%d.%d%s\"\n",
+ @vers[0,1,2],
+ $newver[3] eq "" ? "" : "-".$newver[3]);
+ }
+ }
+
+ open FILE, ">$pubconf" or die "$pubconf: $!\n";
+ print FILE @contents;
+ close FILE;
+}
+
+# Update the Windows-maintained H5pubconf.h file
+gen_h5pubconf("HDF5", $H5PUBCONF, @newver) if $H5PUBCONF;
+
# Print the new version number
if ($verbose) {
printf("version %d.%d release %d%s\n", @newver[0,1,2],