- my $version_h = File::Spec->catfile( $srcdir, 'version.h' );
-
- my $fh = new IO::File $version_h, 'r';
- die "Cannot read version.h: $!\n" unless ( defined $fh );
- my @lines = <$fh>;
- $fh->close() or die "Failed to close-read($version_h): $!\n";
-
- my $found = 0;
- my $i;
- for ( $i = 0 ; $i < @lines ; ++$i ) {
- if ( $lines[$i] =~ /EXIM_VARIANT_VERSION/ ) {
- $found = 1;
- last;
- }
- }
- die "Cannot find version.h EXIM_VARIANT_VERSION\n" unless $found;
- unless ( $lines[$i] =~ m/^\s* \# \s* define \s+ EXIM_VARIANT_VERSION \s+ "(.*)" \s* $/x ) {
- die "Broken version.h EXIM_VARIANT_VERSION line\n";
- }
- if ( length $1 ) {
- print( "WARNING: version.h has a variant tag already defined: $1\n" );
- print( " not changing that tag\n" );
+ chdir $srcdir or die "chdir $srcdir: $\n";
+
+ if ( -f "version.sh" ) {
+ print( "WARNING: version.sh already exists - leaving it in place\n" );