diff options
Diffstat (limited to 'make_dist')
-rwxr-xr-x | make_dist | 27 |
1 files changed, 24 insertions, 3 deletions
@@ -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; } |