aboutsummaryrefslogtreecommitdiffstats
path: root/make_dist
diff options
context:
space:
mode:
Diffstat (limited to 'make_dist')
-rwxr-xr-xmake_dist27
1 files changed, 24 insertions, 3 deletions
diff --git a/make_dist b/make_dist
index dbbab032..0d94f194 100755
--- a/make_dist
+++ b/make_dist
@@ -121,16 +121,37 @@ sub get_version_from_configure
sub get_version_from_source
{
- my $fh = safe_open("libqpdf/QPDF.cc");
+ my $fh = safe_open("include/qpdf/DLL.h");
my $code_version = 'unknown';
+ my $major = '';
+ my $minor = '';
+ my $patch = '';
while (<$fh>)
{
- if (m/QPDF::qpdf_version = \"([^\"]+)\"/)
+ if (m/QPDF_MAJOR_VERSION (\d+)/)
+ {
+ $major = $1;
+ }
+ elsif (m/QPDF_MINOR_VERSION (\d+)/)
+ {
+ $minor = $1;
+ }
+ elsif (m/QPDF_PATCH_VERSION (\d+)/)
+ {
+ $patch = $1;
+ }
+ elsif (m/QPDF_VERSION \"([^\"]+)\"/)
{
$code_version = $1;
- last;
}
}
+ my $t = sprintf("%s.%s.%s", $major, $minor, $patch);
+ if ($t ne $code_version)
+ {
+ die "$whoami: version is inconsistent in DLL.h:" .
+ " $t vs $code_version\n";
+ }
+
$fh->close();
$code_version;
}