summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2015-04-17 22:24:47 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2015-04-17 22:24:47 (GMT)
commitcf98752566a33067a5737e8a008dc5daa1f4c59c (patch)
treef173ff0f0159db1d4e37826f5f203e996d5da2e2 /bin
parent7bf3a426e8634c851d9c550fd980f07d3e29fc1b (diff)
downloadhdf5-cf98752566a33067a5737e8a008dc5daa1f4c59c.zip
hdf5-cf98752566a33067a5737e8a008dc5daa1f4c59c.tar.gz
hdf5-cf98752566a33067a5737e8a008dc5daa1f4c59c.tar.bz2
[svn-r26840] configure
configure.ac hl/src/H5LTparse.c hl/src/H5LTparse.h Address HDFFV-9010: configure issue with gcc 4.9.2 "-l ". Change default to disable_shared on CYGWIN. release_docs/INSTALL_Cygwin.txt release_docs/RELEASE.txt Update for changed default and no CYGWIN szip binary. c++/src/cpp_doc_config bin/h5vers AddressHDFFV-9010: Add cpp_doc_config to h5vers Tested with h5committest, on CYGWIN.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/h5vers47
1 files changed, 46 insertions, 1 deletions
diff --git a/bin/h5vers b/bin/h5vers
index cb4b9e0..2aa8023 100755
--- a/bin/h5vers
+++ b/bin/h5vers
@@ -187,6 +187,10 @@ die "unable to read file: $RELEASE\n" unless -r $file;
my $CONFIGURE = $file;
$CONFIGURE =~ s/[^\/]*$/..\/configure.ac/;
die "unable to read file: $CONFIGURE\n" unless -r $file;
+# cpp_doc_config
+my $CPP_DOC_CONFIG = $file;
+$CPP_DOC_CONFIG =~ s/[^\/]*$/..\/c++\/src\/cpp_doc_config/;
+die "unable to read file: $CPP_DOC_CONFIG\n" unless -r $file;
# Get the current version number.
open FILE, $file or die "unable to open $file: $!\n";
@@ -234,7 +238,8 @@ if ($set) {
$README = "";
$RELEASE = "";
$CONFIGURE = "";
- $LT_VERS = "";
+ $CPP_DOC_CONFIG = "";
+ $LT_VERS = "";
@newver = @curver;
}
@@ -309,6 +314,46 @@ if ($RELEASE) {
close FILE;
}
+# Update the c++/src/cpp_doc_config file
+if ($CPP_DOC_CONFIG) {
+ my $data = read_file($CPP_DOC_CONFIG);
+ my $version_string = sprintf("HDF5 version %d.%d.%d%s %s",
+ @newver[0,1,2],
+ $newver[3] eq "" ? "" : "-".$newver[3],
+ "currently under development");
+
+ $data =~ s/PROJECT_NUMBER\s*=.*/PROJECT_NUMBER = $version_string/;
+
+ write_file($CPP_DOC_CONFIG, $data);
+}
+
+# helper function to read the file for updating c++/src/cpp_doc_config file.
+# The version string in that file is not at the top, so the string replacement
+# is not for the first line, and reading/writing the entire file as one string
+# facilitates the substring replacement.
+sub read_file {
+ my ($filename) = @_;
+
+ open my $in, $filename or die "Could not open '$filename' for reading $!";
+ local $/ = undef;
+ my $all = <$in>;
+ close $in;
+
+ return $all;
+}
+
+# helper function to write the file for updating c++/src/cpp_doc_config file.
+sub write_file {
+ my ($filename, $content) = @_;
+
+ open my $out, ">$filename" or die "Could not open '$filename' for writing $!";;
+ print $out $content;
+ close $out;
+
+ return;
+}
+
+
sub gen_configure {
my ($name, $conf) = @_;