~ubuntu-branches/ubuntu/lucid/knetfilter/lucid

« back to all changes in this revision

Viewing changes to admin/conf.change.pl

  • Committer: Bazaar Package Importer
  • Author(s): Angel Ramos
  • Date: 2005-03-17 17:40:18 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050317174018-qychsdv5ifzdmblo
Tags: 3.3.1-3
Renamed mark.xpm icon. Solved conflict with kxsldbg. Thanks again
Javier. (Closes: #301886, #302534).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl -w
 
1
#!/usr/bin/env perl
2
2
 
3
3
# this script patches a config.status file, to use our own perl script
4
4
# in the main loop
5
5
# we do it this way to circumvent hacking (and thereby including)
6
6
# autoconf function (which are GPL) into our LGPL acinclude.m4.in
7
 
# written by Michael Matz <matz@ifh.de>
 
7
# written by Michael Matz <matz@kde.org>
 
8
# adapted by Dirk Mueller <mueller@kde.org>
 
9
#
 
10
#   This file is free software; you can redistribute it and/or
 
11
#   modify it under the terms of the GNU Library General Public
 
12
#   License as published by the Free Software Foundation; either
 
13
#   version 2 of the License, or (at your option) any later version.
 
14
 
 
15
#   This library is distributed in the hope that it will be useful,
 
16
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
18
#   Library General Public License for more details.
 
19
 
 
20
#   You should have received a copy of the GNU Library General Public License
 
21
#   along with this library; see the file COPYING.LIB.  If not, write to
 
22
#   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
23
#   Boston, MA 02111-1307, USA.
8
24
 
9
25
# we have to change two places
10
26
# 1. the splitting of the substitutions into chunks of 90 (or even 48 in
11
27
#    later autoconf's
12
28
# 2. the big main loop which patches all Makefile.in's
 
29
 
 
30
use strict;
13
31
use File::Basename;
14
32
 
15
33
my $ac_aux_dir = dirname($0);
32
50
#    ends with (excluding) "CONFIG_FILE=..."
33
51
#    in later autoconf (2.14.1) there is no CONFIG_FILES= line,
34
52
#    but instead the (2) directly follow (1)
35
 
        if (/^\s*ac_max_sed_([a-z]+).*=\s*[0-9]+/ ) {
 
53
        if (/^\s*ac_max_sed_([a-z]+).*=\s*([0-9]+)/ ) {
36
54
            $flag = 1;
37
55
            if ($1 eq 'lines') {
 
56
                # lets hope its different with 2141, 
 
57
                # wasn't able to verify that
 
58
              if ($2 eq '48') {
 
59
                $ac_version = 250;
 
60
              }
 
61
              else {
38
62
                $ac_version = 2141;
 
63
              }
39
64
            } elsif ($1 eq 'cmds') {
40
65
                $ac_version = 213;
41
66
            }
44
69
            print;
45
70
        }
46
71
    } elsif ($flag == 1) {
47
 
        if (/^\s*CONFIG_FILES=/ ) {
 
72
        if (/^\s*CONFIG_FILES=/ && ($ac_version != 250)) {
48
73
             print;
49
74
             $flag = 2;
50
75
        } elsif (/^\s*for\s+ac_file\s+in\s+.*CONFIG_FILES/ ) {
51
76
             $flag = 3;
52
 
             if ($ac_version != 2141) {
53
 
                 $ac_version = 2141;
54
 
             }
55
77
        }
56
78
    } elsif ($flag == 2) {
57
79
# 2. begins with: "for ac_file in.*CONFIG_FILES"  (the next 'for' after (1))
58
80
#    end with: "rm -f conftest.s\*"
 
81
# on autoconf 250, it ends with '# CONFIG_HEADER section'
 
82
#
 
83
# gg: if a post-processing commands section is found first, 
 
84
#    stop there and insert a new loop to honour the case/esac.
 
85
# (pattern: /^\s+#\sRun the commands associated with the file./)
 
86
 
59
87
        if (/^\s*for\s+ac_file\s+in\s+.*CONFIG_FILES/ ) {
60
88
            $flag = 3;
61
89
        } else {
64
92
    } elsif ($flag == 3) {
65
93
        if (/^\s*rm\s+-f\s+conftest/ ) {
66
94
            $flag = 4;
67
 
            insert_main_loop();
 
95
            &insert_main_loop();
68
96
        } elsif (/^\s*rm\s+-f\s+.*ac_cs_root/ ) {
69
97
            $flag = 4;
70
 
            insert_main_loop();
 
98
            &insert_main_loop();
71
99
            #die "hhhhhhh";
72
100
            if ($ac_version != 2141) {
73
101
                print STDERR "hmm, don't know autoconf version\n";
74
102
            }
 
103
        } elsif (/^\#\s*CONFIG_(HEADER|COMMANDS) section.*|^\s+#\s(Run) the commands associated/) {
 
104
          $flag = 4;
 
105
          my $commands = defined $2;
 
106
          &insert_main_loop();
 
107
          $commands && insert_command_loop();
 
108
          if($ac_version != 250) {
 
109
            print STDERR "hmm, something went wrong :-(\n";
 
110
          }
75
111
        } elsif (/VPATH/ ) {
76
112
            $vpath_seen = 1;
77
113
        }
82
118
print STDERR "hmm, don't know autoconf version\n" unless $ac_version;
83
119
 
84
120
sub insert_main_loop {
 
121
 
 
122
  if ($ac_version == 250) {
 
123
    &insert_main_loop_250();
 
124
  }
 
125
  else {
 
126
    &insert_main_loop_213();
 
127
  }
 
128
}
 
129
 
 
130
sub insert_main_loop_250 {
 
131
 
 
132
  print <<EOF;
 
133
  #echo Doing the fast build of Makefiles -- autoconf $ac_version
 
134
EOF
 
135
    if ($vpath_seen) {
 
136
        print <<EOF;
 
137
        # VPATH subst was seen in original config.status main loop
 
138
  echo '/^[     ]*VPATH[        ]*=[^:]*\$/d' >>\$tmp/subs.sed
 
139
EOF
 
140
      }
 
141
  print <<EOF;
 
142
  rm -f \$tmp/subs.files
 
143
  for ac_file in .. \$CONFIG_FILES ; do
 
144
      if test "x\$ac_file" != x..; then
 
145
          echo \$ac_file >> \$tmp/subs.files
 
146
      fi
 
147
  done
 
148
  if test -f \$tmp/subs.files ; then
 
149
      perl $ac_aux_dir/config.pl "\$tmp/subs.sed" "\$tmp/subs.files" "\$srcdir" "\$INSTALL"
 
150
  fi
 
151
  rm -f \$tmp/subs.files
 
152
 
 
153
fi
 
154
EOF
 
155
  return;
 
156
}
 
157
 
 
158
sub insert_main_loop_213 {
85
159
    print <<EOF;
86
160
#echo Doing the fast build of Makefiles -- autoconf $ac_version
87
161
if test "x\$ac_cs_root" = "x" ; then
89
163
fi
90
164
EOF
91
165
    if ($vpath_seen) {
92
 
        print <<EOF;
 
166
      print <<EOF;
93
167
# VPATH subst was seen in original config.status main loop
94
168
echo '/^[       ]*VPATH[        ]*=[^:]*\$/d' >> \$ac_cs_root.subs
95
169
EOF
102
176
    fi
103
177
done
104
178
if test -f \$ac_cs_root.sacfiles ; then
105
 
    perl $ac_aux_dir/config.pl "\$ac_cs_root" "\$ac_given_srcdir" "\$ac_given_INSTALL"
 
179
    perl $ac_aux_dir/config.pl "\$ac_cs_root.subs" "\$ac_cs_root.sacfiles" "\$ac_given_srcdir" "\$ac_given_INSTALL"
106
180
fi
107
181
rm -f \$ac_cs_root.s*
108
182
 
109
183
EOF
110
184
    return;
111
185
}
 
186
 
 
187
sub insert_command_loop {
 
188
    print <<EOF;
 
189
  for ac_file in .. \$CONFIG_FILES ; do
 
190
EOF
 
191
}