@@ -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) {
157155die " 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
166163unless ($file ) {
167164 for (@files) {
@@ -178,6 +175,10 @@ die "unable to read file: $LT_VERS\n" unless -r $file;
178175my $HDF5CONFIGCMAKE = $file ;
179176$HDF5CONFIGCMAKE =~ s/[^\/ ]* $/..\/ config\/ cmake\/ scripts\/ HDF5config.cmake/;
180177die " 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
182183my $README = $file ;
183184$README =~ s/[^\/ ]* $/..\/ README.md/;
@@ -190,10 +191,6 @@ die "unable to read file: $RELEASE\n" unless -r $file;
190191my $NEWS = $file ;
191192$NEWS =~ s/[^\/ ]* $/..\/ release_docs\/ NEWSLETTER.txt/;
192193die " 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 ;
197194my $H5_JAVA = $file ;
198195$H5_JAVA =~ s/[^\/ ]* $/..\/ java\/ src\/ hdf\/ hdf5lib\/ H5.java/;
199196die " 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
366380if ($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-
477454sub gen_h5pubconf {
478455 my ($name , $pubconf , @vers) = @_;
479456
0 commit comments