diff options
author | Laurent Montel <lmontel@mandriva.org> | 2002-05-28 07:51:41 +0000 |
---|---|---|
committer | Laurent Montel <lmontel@mandriva.org> | 2002-05-28 07:51:41 +0000 |
commit | 30ece5837b50f59a9d2ae1cb55838a8c7dea0cab (patch) | |
tree | 0bfcd457e0654a759c47395f30767521d1d22c88 /krootwarning/admin/config.pl | |
parent | de5acf37c29eead41fc02a65e961271fe8369f16 (diff) | |
download | common-data-30ece5837b50f59a9d2ae1cb55838a8c7dea0cab.tar common-data-30ece5837b50f59a9d2ae1cb55838a8c7dea0cab.tar.gz common-data-30ece5837b50f59a9d2ae1cb55838a8c7dea0cab.tar.bz2 common-data-30ece5837b50f59a9d2ae1cb55838a8c7dea0cab.tar.xz common-data-30ece5837b50f59a9d2ae1cb55838a8c7dea0cab.zip |
Fix compile with qt3
Diffstat (limited to 'krootwarning/admin/config.pl')
-rw-r--r-- | krootwarning/admin/config.pl | 94 |
1 files changed, 59 insertions, 35 deletions
diff --git a/krootwarning/admin/config.pl b/krootwarning/admin/config.pl index 011cd25..d712b2e 100644 --- a/krootwarning/admin/config.pl +++ b/krootwarning/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 =~ /\.\./; |