Commit 702058a1c308d6ee0d02815946309f6f875c88d8

Authored by Jay Berkenbilt
Committed by Jay Berkenbilt
1 parent 2515498c

Convert make_dist to use cmake

Showing 1 changed file with 18 additions and 19 deletions
make_dist
@@ -21,11 +21,7 @@ my $ci_mode = 0; @@ -21,11 +21,7 @@ my $ci_mode = 0;
21 my $version = undef; 21 my $version = undef;
22 foreach my $arg (@ARGV) 22 foreach my $arg (@ARGV)
23 { 23 {
24 - if ($arg eq '--no-tests')  
25 - {  
26 - # ignore for compatibility  
27 - }  
28 - elsif ($arg eq '--keep-tmp') 24 + if ($arg eq '--keep-tmp')
29 { 25 {
30 $keep_tmp = 1; 26 $keep_tmp = 1;
31 } 27 }
@@ -45,7 +41,7 @@ foreach my $arg (@ARGV) @@ -45,7 +41,7 @@ foreach my $arg (@ARGV)
45 41
46 if ($ci_mode && (! defined $version)) 42 if ($ci_mode && (! defined $version))
47 { 43 {
48 - $version = get_version_from_configure(); 44 + $version = get_version_from_cmake();
49 } 45 }
50 46
51 usage() unless defined $version; 47 usage() unless defined $version;
@@ -61,14 +57,14 @@ run("git archive --prefix=qpdf-$version/ HEAD . | (cd $tmp; tar xf -)"); @@ -61,14 +57,14 @@ run("git archive --prefix=qpdf-$version/ HEAD . | (cd $tmp; tar xf -)");
61 cd($tmpdir); 57 cd($tmpdir);
62 58
63 # Check versions 59 # Check versions
64 -my $config_version = get_version_from_configure(); 60 +my $cmakeversion = get_version_from_cmake();
65 my $code_version = get_version_from_source(); 61 my $code_version = get_version_from_source();
66 my $doc_version = get_version_from_manual(); 62 my $doc_version = get_version_from_manual();
67 63
68 my $version_error = 0; 64 my $version_error = 0;
69 -if ($version ne $config_version) 65 +if ($version ne $cmakeversion)
70 { 66 {
71 - print "$whoami: configure.ac version = $config_version\n"; 67 + print "$whoami: cmake version = $cmakeversion\n";
72 $version_error = 1; 68 $version_error = 1;
73 } 69 }
74 if ($version ne $code_version) 70 if ($version ne $code_version)
@@ -103,20 +99,26 @@ make a backup of the release tar file. @@ -103,20 +99,26 @@ make a backup of the release tar file.
103 99
104 "; 100 ";
105 101
106 -sub get_version_from_configure 102 +sub get_version_from_cmake
107 { 103 {
108 - my $fh = safe_open("configure.ac");  
109 - my $config_version = 'unknown'; 104 + my $fh = safe_open("CMakeLists.txt");
  105 + my $cmake_version = 'unknown';
  106 + my $saw_project = 0;
110 while (<$fh>) 107 while (<$fh>)
111 { 108 {
112 - if (m/^AC_INIT\(\[qpdf\],\[([^\)]+)\]\)/) 109 + print;
  110 + if (m/project\(qpdf/)
113 { 111 {
114 - $config_version = $1; 112 + $saw_project = 1;
  113 + }
  114 + elsif ($saw_project && m/VERSION (\S+)$/)
  115 + {
  116 + $cmake_version = $1;
115 last; 117 last;
116 } 118 }
117 } 119 }
118 $fh->close(); 120 $fh->close();
119 - $config_version; 121 + $cmake_version;
120 } 122 }
121 123
122 sub get_version_from_source 124 sub get_version_from_source
@@ -194,10 +196,7 @@ sub cd @@ -194,10 +196,7 @@ sub cd
194 sub usage 196 sub usage
195 { 197 {
196 die " 198 die "
197 -Usage: $whoami [ --no-tests --keep-tmp ] version  
198 -  
199 -Use of --no-tests can be used for internally testing releases, but do  
200 -not use it for a real release. 199 +Usage: $whoami [--keep-tmp] {--ci|version}
201 200
202 $whoami creates ${tmp}/qpdf-<version> and deletes it when done. With 201 $whoami creates ${tmp}/qpdf-<version> and deletes it when done. With
203 --keep-tmp, the directory is kept. This can be useful for debugging 202 --keep-tmp, the directory is kept. This can be useful for debugging