Skip to content

Commit f8d8933

Browse files
authored
Remove setting HDF5 version for configure.ac (#5789)
Add setting HDF5 version for config/examples/HDF5AsSubdirMacros.cmake in bin/h5vers. Set HDF5 version to 2.0.0-1 for snapshot release.
1 parent 71f6b42 commit f8d8933

File tree

7 files changed

+34
-56
lines changed

7 files changed

+34
-56
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
HDF5 version 2.0.0 currently under development
1+
HDF5 version 2.0.0-1 currently under development
22

33
> [!WARNING]
44
> **Heads Up: HDF5 Dropped Autotools March 10th**

bin/h5vers

Lines changed: 26 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ use strict;
6565
# If the version number is changed (either `-s' or `-i' was used on
6666
# the command line) then the version line of the README.md and RELEASE.txt files
6767
# one directory above the H5public.h file is also modified so it looks
68-
# something like: This is hdf5-1.2.3-pre1 currently under development.
69-
# The AC_INIT macro in configure.ac will also change in this case to be
70-
# something like: AC_INIT([HDF5], [hdf5-1.2.3-pre1], [[email protected]])
68+
# something like: This is hdf5-2.0.1-1 currently under development.
7169
# Version changes are also reflected in the Windows-maintained H5pubconf.h
7270
# file.
7371
#
@@ -157,11 +155,10 @@ while ($_ = shift) {
157155
die "mutually exclusive options given\n" if $set && $inc;
158156

159157
# Determine file to use as H5public.h, README.md,
160-
# release_docs/RELEASE.txt, configure.ac, windows/src/H5pubconf.h
158+
# release_docs/RELEASE.txt, windows/src/H5pubconf.h
161159
# config/lt_vers.am and config/cmake/scripts/HDF5config.cmake.
162-
# The README.md, release_docs/RELEASE.txt, configure.ac,
163-
# windows/src/H5pubconf.h, config/lt_vers.am and
164-
# config/cmake/scripts/HDF5config.cmake
160+
# The README.md, release_docs/RELEASE.txt, # windows/src/H5pubconf.h,
161+
# config/lt_vers.am and config/cmake/scripts/HDF5config.cmake
165162
# files are always in the directory above H5public.h
166163
unless ($file) {
167164
for (@files) {
@@ -178,6 +175,10 @@ die "unable to read file: $LT_VERS\n" unless -r $file;
178175
my $HDF5CONFIGCMAKE = $file;
179176
$HDF5CONFIGCMAKE =~ s/[^\/]*$/..\/config\/cmake\/scripts\/HDF5config.cmake/;
180177
die "unable to read file: $HDF5CONFIGCMAKE\n" unless -r $file;
178+
179+
my $HDF5EXCONFCMAKE = $file;
180+
$HDF5EXCONFCMAKE =~ s/[^\/]*$/..\/config\/examples\/HDF5AsSubdirMacros.cmake/;
181+
die "unable to read file: $HDF5EXCONFCMAKE\n" unless -r $file;
181182
# README.md
182183
my $README = $file;
183184
$README =~ s/[^\/]*$/..\/README.md/;
@@ -190,10 +191,6 @@ die "unable to read file: $RELEASE\n" unless -r $file;
190191
my $NEWS = $file;
191192
$NEWS =~ s/[^\/]*$/..\/release_docs\/NEWSLETTER.txt/;
192193
die "unable to read file: $NEWS\n" unless -r $file;
193-
# configure.ac
194-
my $CONFIGURE = $file;
195-
$CONFIGURE =~ s/[^\/]*$/..\/configure.ac/;
196-
die "unable to read file: $CONFIGURE\n" unless -r $file;
197194
my $H5_JAVA = $file;
198195
$H5_JAVA =~ s/[^\/]*$/..\/java\/src\/hdf\/hdf5lib\/H5.java/;
199196
die "unable to read file: $H5_JAVA\n" unless -r $file;
@@ -250,9 +247,9 @@ if ($set) {
250247
$README = "";
251248
$RELEASE = "";
252249
$NEWS = "";
253-
$CONFIGURE = "";
254250
$LT_VERS = "";
255251
$HDF5CONFIGCMAKE = "";
252+
$HDF5EXCONFCMAKE = "";
256253
@newver = @curver;
257254
}
258255

@@ -362,6 +359,23 @@ if ($HDF5CONFIGCMAKE) {
362359
write_file($HDF5CONFIGCMAKE, $data);
363360
}
364361

362+
# Update the config/examples/HDF5AsSubdirMacros.cmake file
363+
if ($HDF5EXCONFCMAKE) {
364+
my $data = read_file($HDF5EXCONFCMAKE);
365+
# my $sub_rel_ver_str = "";
366+
my $sub_rel_ver_str = (
367+
$newver[3] eq ""
368+
? sprintf("\"%s\"", "")
369+
: sprintf("\"%s\"", "-".$newver[3])
370+
);
371+
my $version_string = sprintf("\"%d.%d.%d\"", @newver[0,1,2]);
372+
373+
$data =~ s/set \(HDF5_VERSION .*\)/set \(HDF5_VERSION $version_string\)/;
374+
$data =~ s/set \(HDF5_VERSEXT .*\)/set \(HDF5_VERSEXT $sub_rel_ver_str\)/;
375+
376+
write_file($HDF5EXCONFCMAKE, $data);
377+
}
378+
365379
# Update the java/src/hdf/hdf5lib/H5.java file
366380
if ($H5_JAVA) {
367381
my $data = read_file($H5_JAVA);
@@ -437,43 +451,6 @@ sub write_file {
437451
return;
438452
}
439453

440-
441-
sub gen_configure {
442-
my ($name, $conf) = @_;
443-
444-
open FILE, $conf or die "$conf: $!\n";
445-
my @contents = <FILE>;
446-
close FILE;
447-
448-
for (my $i = 0; $i < $#contents; ++$i) {
449-
if ($contents[$i] =~ /^AC_INIT/) {
450-
$contents[$i] = sprintf("AC_INIT([$name], [%d.%d.%d%s], [help\@hdfgroup.org])\n",
451-
@newver[0,1,2],
452-
$newver[3] eq "" ? "" : "-".$newver[3]);
453-
last;
454-
}
455-
}
456-
457-
open FILE, ">$conf" or die "$conf: $!\n";
458-
print FILE @contents;
459-
close FILE;
460-
461-
$conf =~ /^(.*?)\/?configure.ac$/;
462-
463-
if ($1) {
464-
$rc = system("cd $1 && ./autogen.sh >/dev/null 2>/dev/null && rm -rf autom4te.cache");
465-
} else {
466-
$rc = system("./autogen.sh >/dev/null 2>/dev/null && rm -rf autom4te.cache");
467-
}
468-
if ($rc) {
469-
printf("./autogen.sh failed with exit code %d. Aborted.\n", $rc);
470-
exit 1;
471-
}
472-
}
473-
474-
# Update the configure.ac files and regenerate them
475-
gen_configure("HDF5", $CONFIGURE) if $CONFIGURE;
476-
477454
sub gen_h5pubconf {
478455
my ($name, $pubconf, @vers) = @_;
479456

config/cmake/scripts/HDF5config.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cmake_minimum_required (VERSION 3.26)
3939
##############################################################################
4040

4141
set (CTEST_SOURCE_VERSION "2.0.0")
42-
set (CTEST_SOURCE_VERSEXT "")
42+
set (CTEST_SOURCE_VERSEXT "-1")
4343

4444
##############################################################################
4545
# handle input parameters to script.

config/examples/HDF5AsSubdirMacros.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# the add_subdirectory command..
1919
macro (EXTERNAL_HDF5_LIBRARY compress_type)
2020
set (HDF5_VERSION "2.0.0")
21+
set (HDF5_VERSEXT "-1")
2122
set (HDF5_VERSION_MAJOR "2.0")
2223
set (HDF5LIB_TGZ_NAME "hdf5.tar.gz" CACHE STRING "Use HDF5LIB from compressed file" FORCE)
2324
set (HDF5LIB_TGZ_ORIGPATH "https://github.com/HDFGroup/hdf5/releases/download/snapshot" CACHE STRING "Use HDF5LIB from original location" FORCE)

release_docs/NEWSLETTER.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
HDF5 version 2.0.0 currently under development
1+
HDF5 version 2.0.0-1 currently under development
22

33
Features included for the next major release:
44
----------------------------------------------------------------------------

release_docs/RELEASE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
HDF5 version 2.0.0 currently under development
1+
HDF5 version 2.0.0-1 currently under development
22
================================================================================
33

44

src/H5public.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@
8787
/**
8888
* For pre-releases like \c snap0. Empty string for official releases.
8989
*/
90-
#define H5_VERS_SUBRELEASE ""
90+
#define H5_VERS_SUBRELEASE "1"
9191
/**
9292
* Short version string
9393
*/
94-
#define H5_VERS_STR "2.0.0"
94+
#define H5_VERS_STR "2.0.0-1"
9595
/**
9696
* Full version string
9797
*/
98-
#define H5_VERS_INFO "HDF5 library version: 2.0.0"
98+
#define H5_VERS_INFO "HDF5 library version: 2.0.0-1"
9999

100100
#define H5check() H5check_version(H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE)
101101

0 commit comments

Comments
 (0)