aboutsummaryrefslogtreecommitdiffstats
path: root/krozat/admin/config.pl
diff options
context:
space:
mode:
Diffstat (limited to 'krozat/admin/config.pl')
-rw-r--r--krozat/admin/config.pl94
1 files changed, 59 insertions, 35 deletions
diff --git a/krozat/admin/config.pl b/krozat/admin/config.pl
index 011cd25..d712b2e 100644
--- a/krozat/admin/config.pl
+++ b/krozat/admin/config.pl
@@ -10,24 +10,39 @@
# this script does better. It changes all Makefile.ins in one process.
# in kdelibs the time for building Makefile went down from 2:59 min to 13 sec!
#
-# written by Michael Matz <matz@ifh.de>
-#
-# the first part was done by looking at the config.status files generated
-# by configure.
-#
-my $ac_cs_root=$ARGV[0];
-my $ac_given_srcdir=$ARGV[1];
-my $ac_given_INSTALL=$ARGV[2];
-
-# print "ac_cs_root=$ac_cs_root\n";
-# print "ac_given_srcdir=$ac_given_srcdir\n";
-# print "ac_given_INSTALL=$ac_given_INSTALL\n";
+# written by Michael Matz <matz@kde.org>
+# adapted by Dirk Mueller <mueller@kde.org>
+
+# This file is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+
+# You should have received a copy of the GNU Library General Public License
+# along with this library; see the file COPYING.LIB. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+my $ac_subs=$ARGV[0];
+my $ac_sacfiles = $ARGV[1];
+my $ac_given_srcdir=$ARGV[2];
+my $ac_given_INSTALL=$ARGV[3];
+
+#print "ac_subs=$ac_subs\n";
+#print "ac_sacfiles=$ac_sacfiles\n";
+#print "ac_given_srcdir=$ac_given_srcdir\n";
+#print "ac_given_INSTALL=$ac_given_INSTALL\n";
my ($srcdir, $top_srcdir);
my $INSTALL;
my $bad_perl = ($] < 5.005);
-open(CF, "< $ac_cs_root.subs") || die "can't open $ac_cs_root.subs: $!";
+open(CF, "< $ac_subs") || die "can't open $ac_subs: $!";
my @subs = <CF>;
close(CF);
chomp @subs;
@@ -41,39 +56,47 @@ if ($bad_perl) {
|| ($pat =~ m%/([^/]*)/([^/]*)/g% )
|| ($pat =~ /s%([^%]*)%([^%]*)%;t/ )
|| ($pat =~ m%/([^/]*)/([^/]*)/;t% )
+ || ($pat =~ /s,([^,]*),(.*),;t/)
) {
# form : s%bla%blubb%g
- # or s%bla%blubb%;t t (newer autoconf)
- push @comp_subs, make_closure($1, $2);
+ # or s%bla%blubb%;t t (autoconf > 2.13 and < 2.52 ?)
+ # or s,bla,blubb,;t t (autoconf 2.52)
+ my $srch = $1;
+ my $repl = $2;
+ $repl =~ s/\\(.)/$1/g;
+ push @comp_subs, make_closure($srch, $repl);
+
} elsif ( ($pat =~ /%([^%]*)%d/ )
|| ($pat =~ m%/([^/]*)/d% )
) {
push @comp_subs, make_closure($1, "");
} else {
- die "Uhh. Malformed pattern in $ac_cs_root.subs ($pat)"
+ die "Uhh. Malformed pattern in $ac_subs ($pat)"
unless ( $pat =~ /^\s*$/ ); # ignore white lines
}
}
} else {
foreach my $pat (@subs) {
- if ( ($pat =~ /s%([^%]*)%([^%]*)%g/ )
- || ($pat =~ m%/([^/]*)/([^/]*)/g% )
- || ($pat =~ /s%([^%]*)%([^%]*)%;t/ )
- || ($pat =~ m%/([^/]*)/([^/]*)/;t% )
- ) {
- # form : s%bla%blubb%g
- # or s%bla%blubb%;t t (newer autoconf)
- push @comp_match, eval "qr/\Q$1\E/"; # compile match pattern
- push @comp_subs, $2;
- } elsif ( ($pat =~ /%([^%]*)%d/ )
- || ($pat =~ m%/([^/]*)/d% )
- ) {
- push @comp_match, eval "qr/\Q$1\E/";
- push @comp_subs, "";
- } else {
- die "Uhh. Malformed pattern in $ac_cs_root.subs ($pat)"
- unless ( $pat =~ /^\s*$/ ); # ignore white lines
- }
+ if ( ($pat =~ /s%([^%]*)%([^%]*)%g/ ) ||
+ ($pat =~ /s%([^%]*)%([^%]*)%;t/ ) ||
+ ($pat =~ /s,([^,]*),(.*),;t/) ) {
+ # form : s%bla%blubb%g
+ # or s%bla%blubb%;t t (autoconf > 2.13 and < 2.52 ?)
+ # or s,bla,blubb,;t t (autoconf 2.52)
+ my $srch = $1;
+ my $repl = $2;
+ push @comp_match, eval "qr/\Q$srch\E/"; # compile match pattern
+ $repl =~ s/\\(.)/$1/g;
+ push @comp_subs, $repl;
+ } elsif ( ($pat =~ /%([^%]*)%d/ )
+ || ($pat =~ m%/([^/]*)/d% )
+ ) {
+ push @comp_match, eval "qr/\Q$1\E/";
+ push @comp_subs, "";
+ } else {
+ die "Uhh. Malformed pattern in $ac_cs_root.subs ($pat)"
+ unless ( $pat =~ /^\s*$/ ); # ignore white lines
+ }
}
}
undef @subs;
@@ -81,11 +104,12 @@ undef @subs;
# read the list of files to be patched, form:
# ./Makefile arts/Makefile arts/examples/Makefile arts/flow/Makefile
-open(CF, "< $ac_cs_root.sacfiles") || die "can't open $ac_cs_root.sacfiles: $!";
+open(CF, "< $ac_sacfiles") || die "can't open $ac_sacfiles: $!";
my @ac_files = <CF>;
close(CF);
chomp @ac_files;
+
my $ac_file;
foreach $ac_file (@ac_files) {
next if $ac_file =~ /\.\./;