Mercurial > hg > easyhg-kdiff3
comparison kdiff3/admin/config.pl @ 14:415083d043f3
KDiff3 version 0.9.70
author | joachim99 |
---|---|
date | Mon, 06 Oct 2003 19:19:11 +0000 |
parents | 53b8ecbce0cb |
children | efe33e938730 |
comparison
equal
deleted
inserted
replaced
13:266aeefa1b11 | 14:415083d043f3 |
---|---|
10 # this script does better. It changes all Makefile.ins in one process. | 10 # this script does better. It changes all Makefile.ins in one process. |
11 # in kdelibs the time for building Makefile went down from 2:59 min to 13 sec! | 11 # in kdelibs the time for building Makefile went down from 2:59 min to 13 sec! |
12 # | 12 # |
13 # written by Michael Matz <matz@kde.org> | 13 # written by Michael Matz <matz@kde.org> |
14 # adapted by Dirk Mueller <mueller@kde.org> | 14 # adapted by Dirk Mueller <mueller@kde.org> |
15 # | 15 |
16 # the first part was done by looking at the config.status files generated | 16 # This file is free software; you can redistribute it and/or |
17 # by configure. | 17 # modify it under the terms of the GNU Library General Public |
18 # | 18 # License as published by the Free Software Foundation; either |
19 # version 2 of the License, or (at your option) any later version. | |
20 | |
21 # This library is distributed in the hope that it will be useful, | |
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
24 # Library General Public License for more details. | |
25 | |
26 # You should have received a copy of the GNU Library General Public License | |
27 # along with this library; see the file COPYING.LIB. If not, write to | |
28 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
29 # Boston, MA 02111-1307, USA. | |
19 | 30 |
20 my $ac_subs=$ARGV[0]; | 31 my $ac_subs=$ARGV[0]; |
21 my $ac_sacfiles = $ARGV[1]; | 32 my $ac_sacfiles = $ARGV[1]; |
22 my $ac_given_srcdir=$ARGV[2]; | 33 my $ac_given_srcdir=$ARGV[2]; |
23 my $ac_given_INSTALL=$ARGV[3]; | 34 my $ac_given_INSTALL=$ARGV[3]; |
39 @comp_subs=(); | 50 @comp_subs=(); |
40 | 51 |
41 if ($bad_perl) { | 52 if ($bad_perl) { |
42 print "Using perl older than version 5.005\n"; | 53 print "Using perl older than version 5.005\n"; |
43 foreach my $pat (@subs) { | 54 foreach my $pat (@subs) { |
44 if ( ($pat =~ /s%([^%]*)%([^%]*)%g/ ) | 55 if ( ($pat =~ m/s%([^%]*)%([^%]*)%g/ ) |
45 || ($pat =~ m%/([^/]*)/([^/]*)/g% ) | 56 || ($pat =~ m/s%([^%]*)%([^%]*)%;t/ ) |
46 || ($pat =~ /s%([^%]*)%([^%]*)%;t/ ) | 57 || ($pat =~ m/s,([^,]*),(.*),;t/) |
47 || ($pat =~ m%/([^/]*)/([^/]*)/;t% ) | 58 || ($pat =~ m%s/([^/]*)/([^/]*)/g% ) |
48 || ($pat =~ /s,([^,]*),(.*),;t/) | 59 || ($pat =~ m%s/([^/]*)/([^/]*)/;t% ) |
49 ) { | 60 ) { |
50 # form : s%bla%blubb%g | 61 # form : s%bla%blubb%g |
51 # or s%bla%blubb%;t t (autoconf > 2.13 and < 2.52 ?) | 62 # or s%bla%blubb%;t t (autoconf > 2.13 and < 2.52 ?) |
52 # or s,bla,blubb,;t t (autoconf 2.52) | 63 # or s,bla,blubb,;t t (autoconf 2.52) |
53 my $srch = $1; | 64 my $srch = $1; |
166 | 177 |
167 patch_file($ac_file, $ac_file_inputs, $ac_comsub); | 178 patch_file($ac_file, $ac_file_inputs, $ac_comsub); |
168 } | 179 } |
169 | 180 |
170 sub patch_file { | 181 sub patch_file { |
171 my ($outf, $infiles, $firstline) = @_; | 182 my ($outf, $infiles, $identline) = @_; |
172 my $filedata; | 183 my $filedata; |
173 my @infiles=split(' ', $infiles); | 184 my @infiles=split(' ', $infiles); |
174 my $i=0; | 185 my $i=0; |
175 | 186 |
176 if ($firstline) { | |
177 $filedata = $firstline; | |
178 } | |
179 foreach my $name (@infiles) { | 187 foreach my $name (@infiles) { |
180 if (open(CF, "< $name")) { | 188 if (open(CF, "< $name")) { |
181 while (<CF>) { | 189 while (<CF>) { |
182 $filedata .= $_; | 190 $filedata .= $_; |
183 } | 191 } |
184 close(CF); | 192 close(CF); |
185 } else { | 193 } else { |
186 print STDERR "can't open $name: $!"."\n"; | 194 print STDERR "can't open $name: $!"."\n"; |
187 } | 195 } |
196 } | |
197 if ($identline) { | |
198 # Put the ident in the second line. For shitty automake 1.6x. | |
199 $filedata =~ s%\n%\n$identline%; | |
188 } | 200 } |
189 | 201 |
190 $filedata =~ s%\@configure_input\@%$configure_input%g; | 202 $filedata =~ s%\@configure_input\@%$configure_input%g; |
191 $filedata =~ s%\@srcdir\@%$srcdir%g; | 203 $filedata =~ s%\@srcdir\@%$srcdir%g; |
192 $filedata =~ s%\@top_srcdir\@%$top_srcdir%g; | 204 $filedata =~ s%\@top_srcdir\@%$top_srcdir%g; |