diff options
author | Scott Wegner <swegner@hdfgroup.org> | 2008-08-06 17:18:47 (GMT) |
---|---|---|
committer | Scott Wegner <swegner@hdfgroup.org> | 2008-08-06 17:18:47 (GMT) |
commit | e47c44c04a4a603911c7220504234df3eae32807 (patch) | |
tree | 8abab77355f31c9f65ed4a59afa61062db4c635e /bin/h5vers | |
parent | 8ee8a3fde6e9052de594c7409656af90cba8ea8a (diff) | |
download | hdf5-e47c44c04a4a603911c7220504234df3eae32807.zip hdf5-e47c44c04a4a603911c7220504234df3eae32807.tar.gz hdf5-e47c44c04a4a603911c7220504234df3eae32807.tar.bz2 |
[svn-r15438] Purpose: 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-x | bin/h5vers | 53 |
1 files changed, 50 insertions, 3 deletions
@@ -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,45 @@ 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 \"$namelc\"\n"; + } elsif ($contents[$i] =~ /\#\s*define\s+H5_PACKAGE_STRING\s+/) { + $contents[$i] = sprintf("\#define H5_PACKAGE_STRING \"$nameuc %d.%d.%d\"\n", + @vers[0,1,2]); + } 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\"\n", + @vers[0,1,2]); + } elsif ($contents[$i] =~ /\#\s*define\s+H5_VERSION\s+/) { + $contents[$i] = sprintf("\#define H5_VERSION \"%d.%d.%d\"\n", + @vers[0,1,2]); + } + } + + printf("opening file for writing"); + open FILE, ">$pubconf" or die "$pubconf: $!\n"; + print FILE "this is a test"; + 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], |