line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Devel::PatchPerl; |
2
|
|
|
|
|
|
|
$Devel::PatchPerl::VERSION = '1.48'; |
3
|
|
|
|
|
|
|
# ABSTRACT: Patch perl source a la Devel::PPPort's buildperl.pl |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
27646
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
48
|
|
6
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
44
|
|
7
|
2
|
|
|
2
|
|
751
|
use File::pushd qw[pushd]; |
|
2
|
|
|
|
|
35086
|
|
|
2
|
|
|
|
|
101
|
|
8
|
2
|
|
|
2
|
|
12
|
use File::Spec; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
28
|
|
9
|
2
|
|
|
2
|
|
761
|
use IO::File; |
|
2
|
|
|
|
|
1206
|
|
|
2
|
|
|
|
|
173
|
|
10
|
2
|
|
|
2
|
|
1552
|
use Devel::PatchPerl::Hints qw[hint_file]; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
97
|
|
11
|
2
|
|
|
2
|
|
784
|
use Module::Pluggable search_path => ['Devel::PatchPerl::Plugin']; |
|
2
|
|
|
|
|
15183
|
|
|
2
|
|
|
|
|
13
|
|
12
|
2
|
|
|
2
|
|
116
|
use vars qw[@ISA @EXPORT_OK]; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
8176
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
15
|
|
|
|
|
|
|
@EXPORT_OK = qw(patch_source); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $patch_exe = _can_run('gpatch') || _can_run('patch'); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my @patch = ( |
20
|
|
|
|
|
|
|
{ |
21
|
|
|
|
|
|
|
perl => [ |
22
|
|
|
|
|
|
|
qw/ |
23
|
|
|
|
|
|
|
5.005 |
24
|
|
|
|
|
|
|
/, |
25
|
|
|
|
|
|
|
], |
26
|
|
|
|
|
|
|
subs => [ |
27
|
|
|
|
|
|
|
[ \&_patch_5_005, 1 ], |
28
|
|
|
|
|
|
|
], |
29
|
|
|
|
|
|
|
}, |
30
|
|
|
|
|
|
|
{ |
31
|
|
|
|
|
|
|
perl => [ |
32
|
|
|
|
|
|
|
qw/ |
33
|
|
|
|
|
|
|
5.005_01 |
34
|
|
|
|
|
|
|
/, |
35
|
|
|
|
|
|
|
], |
36
|
|
|
|
|
|
|
subs => [ |
37
|
|
|
|
|
|
|
[ \&_patch_5_005_01, 1 ], |
38
|
|
|
|
|
|
|
], |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
{ |
41
|
|
|
|
|
|
|
perl => [ |
42
|
|
|
|
|
|
|
qw/ |
43
|
|
|
|
|
|
|
5.005_02 |
44
|
|
|
|
|
|
|
/, |
45
|
|
|
|
|
|
|
], |
46
|
|
|
|
|
|
|
subs => [ |
47
|
|
|
|
|
|
|
[ \&_patch_5_005_02, 1 ], |
48
|
|
|
|
|
|
|
], |
49
|
|
|
|
|
|
|
}, |
50
|
|
|
|
|
|
|
{ |
51
|
|
|
|
|
|
|
perl => [ |
52
|
|
|
|
|
|
|
qr/^5\.00[2345]/, |
53
|
|
|
|
|
|
|
qw/ |
54
|
|
|
|
|
|
|
5.001n |
55
|
|
|
|
|
|
|
/, |
56
|
|
|
|
|
|
|
], |
57
|
|
|
|
|
|
|
subs => [ |
58
|
|
|
|
|
|
|
[ \&_patch_handy, 1 ], |
59
|
|
|
|
|
|
|
], |
60
|
|
|
|
|
|
|
}, |
61
|
|
|
|
|
|
|
{ |
62
|
|
|
|
|
|
|
perl => [ |
63
|
|
|
|
|
|
|
qw/ |
64
|
|
|
|
|
|
|
5.005 |
65
|
|
|
|
|
|
|
5.005_01 |
66
|
|
|
|
|
|
|
5.005_02 |
67
|
|
|
|
|
|
|
5.005_03 |
68
|
|
|
|
|
|
|
5.005_04 |
69
|
|
|
|
|
|
|
/, |
70
|
|
|
|
|
|
|
], |
71
|
|
|
|
|
|
|
subs => [ |
72
|
|
|
|
|
|
|
[ \&_replace_makedepend, 1 ], |
73
|
|
|
|
|
|
|
], |
74
|
|
|
|
|
|
|
}, |
75
|
|
|
|
|
|
|
{ |
76
|
|
|
|
|
|
|
perl => [ |
77
|
|
|
|
|
|
|
qr/^5\.00[01234]/, |
78
|
|
|
|
|
|
|
qw/ |
79
|
|
|
|
|
|
|
5.005 |
80
|
|
|
|
|
|
|
5.005_01 |
81
|
|
|
|
|
|
|
5.005_02 |
82
|
|
|
|
|
|
|
5.005_03 |
83
|
|
|
|
|
|
|
/, |
84
|
|
|
|
|
|
|
], |
85
|
|
|
|
|
|
|
subs => [ |
86
|
|
|
|
|
|
|
[ \&_patch_db, 1 ], |
87
|
|
|
|
|
|
|
], |
88
|
|
|
|
|
|
|
}, |
89
|
|
|
|
|
|
|
{ |
90
|
|
|
|
|
|
|
perl => [ |
91
|
|
|
|
|
|
|
qr/^5\.6\.[1-2]$/, |
92
|
|
|
|
|
|
|
qr/^5\.7\.[0-1]$/, |
93
|
|
|
|
|
|
|
], |
94
|
|
|
|
|
|
|
subs => [ |
95
|
|
|
|
|
|
|
[ \&_patch_makefile_sh_phony ], |
96
|
|
|
|
|
|
|
], |
97
|
|
|
|
|
|
|
}, |
98
|
|
|
|
|
|
|
{ |
99
|
|
|
|
|
|
|
perl => [ |
100
|
|
|
|
|
|
|
qw/ |
101
|
|
|
|
|
|
|
5.6.0 |
102
|
|
|
|
|
|
|
5.6.1 |
103
|
|
|
|
|
|
|
5.7.0 |
104
|
|
|
|
|
|
|
5.7.1 |
105
|
|
|
|
|
|
|
5.7.2 |
106
|
|
|
|
|
|
|
5.7.3 |
107
|
|
|
|
|
|
|
5.8.0 |
108
|
|
|
|
|
|
|
/, |
109
|
|
|
|
|
|
|
], |
110
|
|
|
|
|
|
|
subs => [ |
111
|
|
|
|
|
|
|
[ \&_patch_db, 3 ], |
112
|
|
|
|
|
|
|
], |
113
|
|
|
|
|
|
|
}, |
114
|
|
|
|
|
|
|
{ |
115
|
|
|
|
|
|
|
perl => [ |
116
|
|
|
|
|
|
|
qr/^5\.004_0[1234]$/, |
117
|
|
|
|
|
|
|
], |
118
|
|
|
|
|
|
|
subs => [ |
119
|
|
|
|
|
|
|
[ \&_patch_doio ], |
120
|
|
|
|
|
|
|
], |
121
|
|
|
|
|
|
|
}, |
122
|
|
|
|
|
|
|
{ |
123
|
|
|
|
|
|
|
perl => [ |
124
|
|
|
|
|
|
|
qw/ |
125
|
|
|
|
|
|
|
5.005 |
126
|
|
|
|
|
|
|
5.005_01 |
127
|
|
|
|
|
|
|
5.005_02 |
128
|
|
|
|
|
|
|
/, |
129
|
|
|
|
|
|
|
], |
130
|
|
|
|
|
|
|
subs => [ |
131
|
|
|
|
|
|
|
[ \&_patch_sysv, old_format => 1 ], |
132
|
|
|
|
|
|
|
], |
133
|
|
|
|
|
|
|
}, |
134
|
|
|
|
|
|
|
{ |
135
|
|
|
|
|
|
|
perl => [ |
136
|
|
|
|
|
|
|
qw/ |
137
|
|
|
|
|
|
|
5.005_03 |
138
|
|
|
|
|
|
|
5.005_04 |
139
|
|
|
|
|
|
|
/, |
140
|
|
|
|
|
|
|
qr/^5\.6\.[0-2]$/, |
141
|
|
|
|
|
|
|
qr/^5\.7\.[0-3]$/, |
142
|
|
|
|
|
|
|
qr/^5\.8\.[0-8]$/, |
143
|
|
|
|
|
|
|
qr/^5\.9\.[0-5]$/ |
144
|
|
|
|
|
|
|
], |
145
|
|
|
|
|
|
|
subs => [ |
146
|
|
|
|
|
|
|
[ \&_patch_sysv, old_format => 0 ], |
147
|
|
|
|
|
|
|
], |
148
|
|
|
|
|
|
|
}, |
149
|
|
|
|
|
|
|
{ |
150
|
|
|
|
|
|
|
perl => [ |
151
|
|
|
|
|
|
|
qr/^5\.004_05$/, |
152
|
|
|
|
|
|
|
qr/^5\.005(?:_0[1-4])?$/, |
153
|
|
|
|
|
|
|
qr/^5\.6\.[01]$/, |
154
|
|
|
|
|
|
|
], |
155
|
|
|
|
|
|
|
subs => [ |
156
|
|
|
|
|
|
|
[ \&_patch_configure ], |
157
|
|
|
|
|
|
|
[ \&_patch_makedepend_lc ], |
158
|
|
|
|
|
|
|
], |
159
|
|
|
|
|
|
|
}, |
160
|
|
|
|
|
|
|
{ |
161
|
|
|
|
|
|
|
perl => [ |
162
|
|
|
|
|
|
|
qr/^5\.6\.[0-2]$/, |
163
|
|
|
|
|
|
|
], |
164
|
|
|
|
|
|
|
subs => [ |
165
|
|
|
|
|
|
|
[ \&_patch_conf_gconvert ], |
166
|
|
|
|
|
|
|
[ \&_patch_sort_N ], |
167
|
|
|
|
|
|
|
], |
168
|
|
|
|
|
|
|
}, |
169
|
|
|
|
|
|
|
{ |
170
|
|
|
|
|
|
|
perl => [ |
171
|
|
|
|
|
|
|
'5.8.0', |
172
|
|
|
|
|
|
|
], |
173
|
|
|
|
|
|
|
subs => [ |
174
|
|
|
|
|
|
|
[ \&_patch_makedepend_lc ], |
175
|
|
|
|
|
|
|
], |
176
|
|
|
|
|
|
|
}, |
177
|
|
|
|
|
|
|
{ |
178
|
|
|
|
|
|
|
perl => [ |
179
|
|
|
|
|
|
|
qr/.*/, |
180
|
|
|
|
|
|
|
], |
181
|
|
|
|
|
|
|
subs => [ |
182
|
|
|
|
|
|
|
[ \&_patch_conf_solaris ], |
183
|
|
|
|
|
|
|
[ \&_patch_bitrig ], |
184
|
|
|
|
|
|
|
[ \&_patch_hints ], |
185
|
|
|
|
|
|
|
[ \&_patch_patchlevel ], |
186
|
|
|
|
|
|
|
[ \&_patch_develpatchperlversion ], |
187
|
|
|
|
|
|
|
[ \&_patch_errno_gcc5 ], |
188
|
|
|
|
|
|
|
], |
189
|
|
|
|
|
|
|
}, |
190
|
|
|
|
|
|
|
{ |
191
|
|
|
|
|
|
|
perl => [ |
192
|
|
|
|
|
|
|
qr/^5\.6\.[0-2]$/, |
193
|
|
|
|
|
|
|
qr/^5\.7\.[0-3]$/, |
194
|
|
|
|
|
|
|
qr/^5\.8\.[0-8]$/, |
195
|
|
|
|
|
|
|
], |
196
|
|
|
|
|
|
|
subs => [ |
197
|
|
|
|
|
|
|
[ \&_patch_makedepend_SH ], |
198
|
|
|
|
|
|
|
], |
199
|
|
|
|
|
|
|
}, |
200
|
|
|
|
|
|
|
{ |
201
|
|
|
|
|
|
|
perl => [ |
202
|
|
|
|
|
|
|
qr/^5\.1[0-2]/, |
203
|
|
|
|
|
|
|
], |
204
|
|
|
|
|
|
|
subs => [ |
205
|
|
|
|
|
|
|
[ \&_patch_archive_tar_tests ], |
206
|
|
|
|
|
|
|
[ \&_patch_odbm_file_hints_linux ], |
207
|
|
|
|
|
|
|
], |
208
|
|
|
|
|
|
|
}, |
209
|
|
|
|
|
|
|
{ |
210
|
|
|
|
|
|
|
perl => [ |
211
|
|
|
|
|
|
|
qr/^5.1([24].\d+|0.1)/, |
212
|
|
|
|
|
|
|
], |
213
|
|
|
|
|
|
|
subs => [ |
214
|
|
|
|
|
|
|
[ \&_patch_make_ext_pl ], |
215
|
|
|
|
|
|
|
], |
216
|
|
|
|
|
|
|
}, |
217
|
|
|
|
|
|
|
{ |
218
|
|
|
|
|
|
|
perl => [ qr/^5\.8\.9$/, ], |
219
|
|
|
|
|
|
|
subs => [ [ \&_patch_589_perlio_c ], ], |
220
|
|
|
|
|
|
|
}, |
221
|
|
|
|
|
|
|
{ |
222
|
|
|
|
|
|
|
perl => [ qr/^5\.8\.[89]$/ ], |
223
|
|
|
|
|
|
|
subs => [ [ \&_patch_hsplit_rehash_58 ] ], |
224
|
|
|
|
|
|
|
}, |
225
|
|
|
|
|
|
|
{ |
226
|
|
|
|
|
|
|
perl => [ |
227
|
|
|
|
|
|
|
qr/^5\.10\.1$/, |
228
|
|
|
|
|
|
|
qr/^5\.12\.5$/, |
229
|
|
|
|
|
|
|
], |
230
|
|
|
|
|
|
|
subs => [ [ \&_patch_hsplit_rehash_510 ] ], |
231
|
|
|
|
|
|
|
}, |
232
|
|
|
|
|
|
|
{ |
233
|
|
|
|
|
|
|
perl => [ |
234
|
|
|
|
|
|
|
qr/^5\.18\.0$/, |
235
|
|
|
|
|
|
|
], |
236
|
|
|
|
|
|
|
subs => [ [ \&_patch_regmatch_pointer_5180 ] ], |
237
|
|
|
|
|
|
|
}, |
238
|
|
|
|
|
|
|
{ |
239
|
|
|
|
|
|
|
perl => [ |
240
|
|
|
|
|
|
|
qr/^5\.20\.0$/, |
241
|
|
|
|
|
|
|
], |
242
|
|
|
|
|
|
|
subs => [ [ \&_patch_cow_speed ] ], |
243
|
|
|
|
|
|
|
}, |
244
|
|
|
|
|
|
|
{ |
245
|
|
|
|
|
|
|
perl => [ |
246
|
|
|
|
|
|
|
qr/^5\.6\.[012]$/, |
247
|
|
|
|
|
|
|
qr/^5\.8\.[89]$/, |
248
|
|
|
|
|
|
|
qr/^5\.10\.[01]$/, |
249
|
|
|
|
|
|
|
], |
250
|
|
|
|
|
|
|
subs => [ [ \&_patch_preprocess_options ] ], |
251
|
|
|
|
|
|
|
}, |
252
|
|
|
|
|
|
|
{ |
253
|
|
|
|
|
|
|
perl => [ |
254
|
|
|
|
|
|
|
qr/^5\.18\.3$/, |
255
|
|
|
|
|
|
|
], |
256
|
|
|
|
|
|
|
subs => [ [ \&_patch_5183_metajson ] ], |
257
|
|
|
|
|
|
|
}, |
258
|
|
|
|
|
|
|
{ |
259
|
|
|
|
|
|
|
perl => [ |
260
|
|
|
|
|
|
|
qr/^5\.24\.[01]$/, |
261
|
|
|
|
|
|
|
], |
262
|
|
|
|
|
|
|
subs => [ [ \&_patch_time_hires ] ], |
263
|
|
|
|
|
|
|
}, |
264
|
|
|
|
|
|
|
); |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
sub patch_source { |
267
|
0
|
|
|
0
|
1
|
0
|
my $vers = shift; |
268
|
0
|
0
|
|
|
|
0
|
$vers = shift if eval { $vers->isa(__PACKAGE__) }; |
|
0
|
|
|
|
|
0
|
|
269
|
0
|
|
0
|
|
|
0
|
my $source = shift || '.'; |
270
|
0
|
0
|
|
|
|
0
|
if ( !$vers ) { |
271
|
0
|
|
|
|
|
0
|
$vers = _determine_version($source); |
272
|
0
|
0
|
|
|
|
0
|
if ( $vers ) { |
273
|
0
|
|
|
|
|
0
|
warn "Auto-guessed '$vers'\n"; |
274
|
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
else { |
276
|
0
|
|
|
|
|
0
|
die "You didn't provide a perl version and I don't appear to be in a perl source tree\n"; |
277
|
|
|
|
|
|
|
} |
278
|
|
|
|
|
|
|
} |
279
|
0
|
|
|
|
|
0
|
$source = File::Spec->rel2abs($source); |
280
|
|
|
|
|
|
|
{ |
281
|
0
|
|
|
|
|
0
|
my $dir = pushd( $source ); |
|
0
|
|
|
|
|
0
|
|
282
|
0
|
|
|
|
|
0
|
for my $p ( grep { _is( $_->{perl}, $vers ) } @patch ) { |
|
0
|
|
|
|
|
0
|
|
283
|
0
|
|
|
|
|
0
|
for my $s (@{$p->{subs}}) { |
|
0
|
|
|
|
|
0
|
|
284
|
0
|
|
|
|
|
0
|
my($sub, @args) = @$s; |
285
|
0
|
0
|
|
|
|
0
|
push @args, $vers unless scalar @args; |
286
|
0
|
|
|
|
|
0
|
$sub->(@args); |
287
|
|
|
|
|
|
|
} |
288
|
|
|
|
|
|
|
} |
289
|
0
|
|
|
|
|
0
|
_process_plugin( version => $vers, source => $source, patchexe => $patch_exe ); |
290
|
|
|
|
|
|
|
} |
291
|
|
|
|
|
|
|
} |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
sub _process_plugin { |
294
|
1
|
|
|
1
|
|
6
|
my %args = @_; |
295
|
1
|
50
|
|
|
|
5
|
return unless my $possible = $ENV{PERL5_PATCHPERL_PLUGIN}; |
296
|
1
|
0
|
|
|
|
7
|
my ($plugin) = grep { $possible eq $_ or /\Q$possible\E$/ } __PACKAGE__->plugins; |
|
0
|
|
|
|
|
0
|
|
297
|
1
|
50
|
|
|
|
226
|
unless ( $plugin ) { |
298
|
|
|
|
|
|
|
warn "# You specified a plugin '", $ENV{PERL5_PATCHPERL_PLUGIN}, |
299
|
1
|
|
|
|
|
26
|
"' that isn't installed, just thought you might be interested.\n"; |
300
|
1
|
|
|
|
|
4
|
return; |
301
|
|
|
|
|
|
|
} |
302
|
|
|
|
|
|
|
{ |
303
|
0
|
|
|
|
|
0
|
local $@; |
304
|
0
|
|
|
|
|
0
|
eval "require $plugin"; |
305
|
0
|
0
|
|
|
|
0
|
if ($@) { |
306
|
|
|
|
|
|
|
die "# I tried to load '", $ENV{PERL5_PATCHPERL_PLUGIN}, |
307
|
0
|
|
|
|
|
0
|
"' but it didn't work out. Here is what happened '$@'\n"; |
308
|
|
|
|
|
|
|
} |
309
|
|
|
|
|
|
|
} |
310
|
|
|
|
|
|
|
{ |
311
|
0
|
|
|
|
|
0
|
local $@; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
312
|
0
|
|
|
|
|
0
|
eval { |
313
|
0
|
|
|
|
|
0
|
$plugin->patchperl( |
314
|
|
|
|
|
|
|
%args, |
315
|
|
|
|
|
|
|
); |
316
|
|
|
|
|
|
|
}; |
317
|
0
|
0
|
|
|
|
0
|
if ($@) { |
318
|
0
|
|
|
|
|
0
|
warn "# Warnings from the plugin: '$@'\n"; |
319
|
|
|
|
|
|
|
} |
320
|
|
|
|
|
|
|
} |
321
|
0
|
|
|
|
|
0
|
return 1; |
322
|
|
|
|
|
|
|
} |
323
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
sub _can_run { |
325
|
4
|
|
|
4
|
|
6
|
my $command = shift; |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
# a lot of VMS executables have a symbol defined |
328
|
|
|
|
|
|
|
# check those first |
329
|
4
|
50
|
|
|
|
15
|
if ( $^O eq 'VMS' ) { |
330
|
0
|
|
|
|
|
0
|
require VMS::DCLsym; |
331
|
0
|
|
|
|
|
0
|
my $syms = VMS::DCLsym->new; |
332
|
0
|
0
|
|
|
|
0
|
return $command if scalar $syms->getsym( uc $command ); |
333
|
|
|
|
|
|
|
} |
334
|
|
|
|
|
|
|
|
335
|
4
|
|
|
|
|
20
|
require File::Spec; |
336
|
4
|
|
|
|
|
1361
|
require ExtUtils::MakeMaker; |
337
|
|
|
|
|
|
|
|
338
|
4
|
|
|
|
|
148068
|
my @possibles; |
339
|
|
|
|
|
|
|
|
340
|
4
|
50
|
|
|
|
35
|
if( File::Spec->file_name_is_absolute($command) ) { |
341
|
0
|
|
|
|
|
0
|
return MM->maybe_command($command); |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
} else { |
344
|
4
|
|
|
|
|
55
|
for my $dir ( |
345
|
|
|
|
|
|
|
File::Spec->path, |
346
|
|
|
|
|
|
|
File::Spec->curdir |
347
|
|
|
|
|
|
|
) { |
348
|
32
|
100
|
33
|
|
|
587
|
next if ! $dir || ! -d $dir; |
349
|
28
|
50
|
|
|
|
184
|
my $abs = File::Spec->catfile( $^O eq 'MSWin32' ? Win32::GetShortPathName( $dir ) : $dir, $command); |
350
|
28
|
100
|
|
|
|
65
|
push @possibles, $abs if $abs = MM->maybe_command($abs); |
351
|
|
|
|
|
|
|
} |
352
|
|
|
|
|
|
|
} |
353
|
4
|
50
|
|
|
|
49
|
return @possibles if wantarray; |
354
|
4
|
|
|
|
|
24
|
return shift @possibles; |
355
|
|
|
|
|
|
|
} |
356
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
sub _is |
358
|
|
|
|
|
|
|
{ |
359
|
0
|
|
|
0
|
|
0
|
my($s1, $s2) = @_; |
360
|
|
|
|
|
|
|
|
361
|
0
|
0
|
|
|
|
0
|
defined $s1 != defined $s2 and return 0; |
362
|
|
|
|
|
|
|
|
363
|
0
|
0
|
|
|
|
0
|
ref $s2 and ($s1, $s2) = ($s2, $s1); |
364
|
|
|
|
|
|
|
|
365
|
0
|
0
|
|
|
|
0
|
if (ref $s1) { |
366
|
0
|
0
|
|
|
|
0
|
if (ref $s1 eq 'ARRAY') { |
367
|
0
|
|
0
|
|
|
0
|
_is($_, $s2) and return 1 for @$s1; |
368
|
0
|
|
|
|
|
0
|
return 0; |
369
|
|
|
|
|
|
|
} |
370
|
0
|
|
|
|
|
0
|
return $s2 =~ $s1; |
371
|
|
|
|
|
|
|
} |
372
|
|
|
|
|
|
|
|
373
|
0
|
|
|
|
|
0
|
return $s1 eq $s2; |
374
|
|
|
|
|
|
|
} |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
sub _patch |
377
|
|
|
|
|
|
|
{ |
378
|
0
|
|
|
0
|
|
0
|
my($patch) = @_; |
379
|
0
|
|
|
|
|
0
|
print "patching $_\n" for $patch =~ /^\+{3}\s+(\S+)/gm; |
380
|
0
|
|
|
|
|
0
|
my $diff = 'tmp.diff'; |
381
|
0
|
|
|
|
|
0
|
_write_or_die($diff, $patch); |
382
|
0
|
0
|
|
|
|
0
|
die "No patch utility found\n" unless $patch_exe; |
383
|
0
|
|
|
|
|
0
|
local $ENV{PATCH_GET} = 0; # I can't reproduce this at all, but meh. |
384
|
0
|
|
|
|
|
0
|
_run_or_die("$patch_exe -f -s -p0 <$diff"); |
385
|
0
|
0
|
|
|
|
0
|
unlink $diff or die "unlink $diff: $!\n"; |
386
|
|
|
|
|
|
|
} |
387
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
sub _write_or_die |
389
|
|
|
|
|
|
|
{ |
390
|
0
|
|
|
0
|
|
0
|
my($file, $data) = @_; |
391
|
0
|
0
|
|
|
|
0
|
my $fh = IO::File->new(">$file") or die "$file: $!\n"; |
392
|
0
|
|
|
|
|
0
|
$fh->print($data); |
393
|
|
|
|
|
|
|
} |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
sub _run_or_die |
396
|
|
|
|
|
|
|
{ |
397
|
|
|
|
|
|
|
# print "[running @_]\n"; |
398
|
0
|
0
|
|
0
|
|
0
|
die unless system( @_ ) == 0; |
399
|
|
|
|
|
|
|
} |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
sub determine_version { |
402
|
6
|
|
|
6
|
1
|
2260
|
my $src = shift; |
403
|
6
|
100
|
|
|
|
7
|
$src = shift if eval { $src->isa(__PACKAGE__) }; |
|
6
|
|
|
|
|
35
|
|
404
|
6
|
100
|
|
|
|
12
|
$src = '.' unless $src; |
405
|
6
|
|
|
|
|
8
|
_determine_version($src); |
406
|
|
|
|
|
|
|
} |
407
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
sub _determine_version { |
409
|
8
|
|
|
8
|
|
536
|
my ($source) = @_; |
410
|
8
|
|
|
|
|
55
|
my $patchlevel_h = File::Spec->catfile($source, 'patchlevel.h'); |
411
|
8
|
100
|
|
|
|
109
|
return unless -e $patchlevel_h; |
412
|
7
|
|
|
|
|
6
|
my $version; |
413
|
|
|
|
|
|
|
{ |
414
|
7
|
|
|
|
|
4
|
my %defines; |
|
7
|
|
|
|
|
5
|
|
415
|
7
|
|
|
|
|
139
|
open my $fh, '<', $patchlevel_h; |
416
|
7
|
|
|
|
|
8
|
my @vers; |
417
|
7
|
|
|
|
|
70
|
while (<$fh>) { |
418
|
613
|
|
|
|
|
358
|
chomp; |
419
|
613
|
100
|
|
|
|
1050
|
next unless /^#define/; |
420
|
33
|
|
|
|
|
88
|
my ($foo,$bar) = ( split /\s+/ )[1,2]; |
421
|
33
|
|
|
|
|
87
|
$defines{$foo} = $bar; |
422
|
|
|
|
|
|
|
} |
423
|
7
|
100
|
|
|
|
8
|
if ( my @wotsits = grep { defined $defines{$_} } qw(PERL_REVISION PERL_VERSION PERL_SUBVERSION) ) { |
|
21
|
100
|
|
|
|
42
|
|
424
|
3
|
|
|
|
|
3
|
$version = join '.', map { $defines{$_} } @wotsits; |
|
9
|
|
|
|
|
33
|
|
425
|
|
|
|
|
|
|
} |
426
|
8
|
|
|
|
|
14
|
elsif ( my @watsits = grep { defined $defines{$_} } qw(PATCHLEVEL SUBVERSION) ) { |
427
|
3
|
|
|
|
|
4
|
$version = sprintf '5.%03d_%02d', map { $defines{$_} } @watsits; |
|
6
|
|
|
|
|
34
|
|
428
|
|
|
|
|
|
|
} |
429
|
|
|
|
|
|
|
else { |
430
|
1
|
|
|
|
|
9
|
return; |
431
|
|
|
|
|
|
|
} |
432
|
|
|
|
|
|
|
} |
433
|
6
|
|
|
|
|
14
|
return $version; |
434
|
|
|
|
|
|
|
} |
435
|
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
# adapted from patchlevel.h for use with perls that predate it |
437
|
|
|
|
|
|
|
sub _patch_patchlevel { |
438
|
0
|
0
|
|
0
|
|
|
return if -d '.git'; |
439
|
0
|
|
0
|
|
|
|
my $dpv = $Devel::PatchPerl::VERSION || "(unreleased)"; |
440
|
0
|
0
|
|
|
|
|
open my $plin, "patchlevel.h" or die "Couldn't open patchlevel.h : $!"; |
441
|
0
|
0
|
|
|
|
|
open my $plout, ">patchlevel.new" or die "Couldn't write on patchlevel.new : $!"; |
442
|
0
|
|
|
|
|
|
my $seen=0; |
443
|
0
|
|
|
|
|
|
while (<$plin>) { |
444
|
0
|
0
|
0
|
|
|
|
if (/\t,NULL/ and $seen) { |
445
|
0
|
|
|
|
|
|
print {$plout} qq{\t,"Devel::PatchPerl $dpv"\n}; |
|
0
|
|
|
|
|
|
|
446
|
|
|
|
|
|
|
} |
447
|
0
|
0
|
|
|
|
|
$seen++ if /local_patches\[\]/; |
448
|
0
|
|
|
|
|
|
print {$plout} $_; |
|
0
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
} |
450
|
0
|
0
|
|
|
|
|
close $plout or die "Couldn't close filehandle writing to patchlevel.new : $!"; |
451
|
0
|
0
|
|
|
|
|
close $plin or die "Couldn't close filehandle reading from patchlevel.h : $!"; |
452
|
0
|
0
|
0
|
|
|
|
unlink "patchlevel.bak" or warn "Couldn't unlink patchlevel.bak : $!" |
453
|
|
|
|
|
|
|
if -e "patchlevel.bak"; |
454
|
0
|
0
|
|
|
|
|
rename "patchlevel.h", "patchlevel.bak" or |
455
|
|
|
|
|
|
|
die "Couldn't rename patchlevel.h to patchlevel.bak : $!"; |
456
|
0
|
0
|
|
|
|
|
rename "patchlevel.new", "patchlevel.h" or |
457
|
|
|
|
|
|
|
die "Couldn't rename patchlevel.new to patchlevel.h : $!"; |
458
|
|
|
|
|
|
|
} |
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
sub _patch_hints { |
461
|
0
|
|
|
0
|
|
|
my @os; |
462
|
0
|
|
|
|
|
|
push @os, $^O; |
463
|
0
|
0
|
|
|
|
|
push @os, 'linux' if $^O eq 'gnukfreebsd'; # kfreebsd uses linux hints |
464
|
0
|
|
|
|
|
|
foreach my $os ( @os ) { |
465
|
0
|
0
|
|
|
|
|
return unless my ($file,$data) = hint_file( $os ); |
466
|
0
|
|
|
|
|
|
my $path = File::Spec->catfile( 'hints', $file ); |
467
|
0
|
0
|
|
|
|
|
if ( -e $path ) { |
468
|
0
|
0
|
|
|
|
|
chmod 0644, $path or die "$!\n"; |
469
|
|
|
|
|
|
|
} |
470
|
0
|
0
|
|
|
|
|
open my $fh, '>', $path or die "$!\n"; |
471
|
0
|
|
|
|
|
|
print $fh $data; |
472
|
0
|
|
|
|
|
|
close $fh; |
473
|
|
|
|
|
|
|
} |
474
|
0
|
|
|
|
|
|
return 1; |
475
|
|
|
|
|
|
|
} |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
sub _patch_db |
478
|
|
|
|
|
|
|
{ |
479
|
0
|
|
|
0
|
|
|
my $ver = shift; |
480
|
0
|
|
|
|
|
|
for my $file ('ext/DB_File/DB_File.xs', 'Configure') { |
481
|
0
|
|
|
|
|
|
print "patching $file\n"; |
482
|
0
|
|
|
|
|
|
_run_or_die($^X, '-pi.bak', '-e', "s///", $file); |
483
|
0
|
0
|
|
|
|
|
unlink "$file.bak" if -e "$file.bak"; |
484
|
|
|
|
|
|
|
} |
485
|
|
|
|
|
|
|
} |
486
|
|
|
|
|
|
|
|
487
|
|
|
|
|
|
|
sub _patch_doio |
488
|
|
|
|
|
|
|
{ |
489
|
0
|
|
|
0
|
|
|
_patch(<<'END'); |
490
|
|
|
|
|
|
|
--- doio.c.org 2004-06-07 23:14:45.000000000 +0200 |
491
|
|
|
|
|
|
|
+++ doio.c 2003-11-04 08:03:03.000000000 +0100 |
492
|
|
|
|
|
|
|
@@ -75,6 +75,16 @@ |
493
|
|
|
|
|
|
|
# endif |
494
|
|
|
|
|
|
|
#endif |
495
|
|
|
|
|
|
|
|
496
|
|
|
|
|
|
|
+#if _SEM_SEMUN_UNDEFINED |
497
|
|
|
|
|
|
|
+union semun |
498
|
|
|
|
|
|
|
+{ |
499
|
|
|
|
|
|
|
+ int val; |
500
|
|
|
|
|
|
|
+ struct semid_ds *buf; |
501
|
|
|
|
|
|
|
+ unsigned short int *array; |
502
|
|
|
|
|
|
|
+ struct seminfo *__buf; |
503
|
|
|
|
|
|
|
+}; |
504
|
|
|
|
|
|
|
+#endif |
505
|
|
|
|
|
|
|
+ |
506
|
|
|
|
|
|
|
bool |
507
|
|
|
|
|
|
|
do_open(gv,name,len,as_raw,rawmode,rawperm,supplied_fp) |
508
|
|
|
|
|
|
|
GV *gv; |
509
|
|
|
|
|
|
|
END |
510
|
|
|
|
|
|
|
} |
511
|
|
|
|
|
|
|
|
512
|
|
|
|
|
|
|
sub _patch_sysv |
513
|
|
|
|
|
|
|
{ |
514
|
0
|
|
|
0
|
|
|
my %opt = @_; |
515
|
|
|
|
|
|
|
|
516
|
|
|
|
|
|
|
# check if patching is required |
517
|
0
|
0
|
0
|
|
|
|
return if $^O ne 'linux' or -f '/usr/include/asm/page.h'; |
518
|
|
|
|
|
|
|
|
519
|
0
|
0
|
|
|
|
|
if ($opt{old_format}) { |
520
|
0
|
|
|
|
|
|
_patch(<<'END'); |
521
|
|
|
|
|
|
|
--- ext/IPC/SysV/SysV.xs.org 1998-07-20 10:20:07.000000000 +0200 |
522
|
|
|
|
|
|
|
+++ ext/IPC/SysV/SysV.xs 2007-08-12 10:51:06.000000000 +0200 |
523
|
|
|
|
|
|
|
@@ -3,9 +3,6 @@ |
524
|
|
|
|
|
|
|
#include "XSUB.h" |
525
|
|
|
|
|
|
|
|
526
|
|
|
|
|
|
|
#include |
527
|
|
|
|
|
|
|
-#ifdef __linux__ |
528
|
|
|
|
|
|
|
-#include |
529
|
|
|
|
|
|
|
-#endif |
530
|
|
|
|
|
|
|
#if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM) |
531
|
|
|
|
|
|
|
#include |
532
|
|
|
|
|
|
|
#ifdef HAS_MSG |
533
|
|
|
|
|
|
|
END |
534
|
|
|
|
|
|
|
} |
535
|
|
|
|
|
|
|
else { |
536
|
0
|
|
|
|
|
|
_patch(<<'END'); |
537
|
|
|
|
|
|
|
--- ext/IPC/SysV/SysV.xs.org 2007-08-11 00:12:46.000000000 +0200 |
538
|
|
|
|
|
|
|
+++ ext/IPC/SysV/SysV.xs 2007-08-11 00:10:51.000000000 +0200 |
539
|
|
|
|
|
|
|
@@ -3,9 +3,6 @@ |
540
|
|
|
|
|
|
|
#include "XSUB.h" |
541
|
|
|
|
|
|
|
|
542
|
|
|
|
|
|
|
#include |
543
|
|
|
|
|
|
|
-#ifdef __linux__ |
544
|
|
|
|
|
|
|
-# include |
545
|
|
|
|
|
|
|
-#endif |
546
|
|
|
|
|
|
|
#if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM) |
547
|
|
|
|
|
|
|
#ifndef HAS_SEM |
548
|
|
|
|
|
|
|
# include |
549
|
|
|
|
|
|
|
END |
550
|
|
|
|
|
|
|
} |
551
|
|
|
|
|
|
|
} |
552
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
sub _patch_configure |
554
|
|
|
|
|
|
|
{ |
555
|
0
|
|
|
0
|
|
|
_patch(<<'END'); |
556
|
|
|
|
|
|
|
--- Configure |
557
|
|
|
|
|
|
|
+++ Configure |
558
|
|
|
|
|
|
|
@@ -3380,6 +3380,18 @@ |
559
|
|
|
|
|
|
|
test "X$gfpthkeep" != Xy && gfpth="" |
560
|
|
|
|
|
|
|
EOSC |
561
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
+# gcc 3.1 complains about adding -Idirectories that it already knows about, |
563
|
|
|
|
|
|
|
+# so we will take those off from locincpth. |
564
|
|
|
|
|
|
|
+case "$gccversion" in |
565
|
|
|
|
|
|
|
+3*) |
566
|
|
|
|
|
|
|
+ echo "main(){}">try.c |
567
|
|
|
|
|
|
|
+ for incdir in `$cc -v -c try.c 2>&1 | \ |
568
|
|
|
|
|
|
|
+ sed '1,/^#include <\.\.\.>/d;/^End of search list/,$d;s/^ //'` ; do |
569
|
|
|
|
|
|
|
+ locincpth=`echo $locincpth | sed s!$incdir!!` |
570
|
|
|
|
|
|
|
+ done |
571
|
|
|
|
|
|
|
+ $rm -f try try.* |
572
|
|
|
|
|
|
|
+esac |
573
|
|
|
|
|
|
|
+ |
574
|
|
|
|
|
|
|
: What should the include directory be ? |
575
|
|
|
|
|
|
|
echo " " |
576
|
|
|
|
|
|
|
$echo $n "Hmm... $c" |
577
|
|
|
|
|
|
|
END |
578
|
|
|
|
|
|
|
} |
579
|
|
|
|
|
|
|
|
580
|
|
|
|
|
|
|
sub _patch_makedepend_lc |
581
|
|
|
|
|
|
|
{ |
582
|
0
|
|
|
0
|
|
|
_patch(<<'END'); |
583
|
|
|
|
|
|
|
--- makedepend.SH |
584
|
|
|
|
|
|
|
+++ makedepend.SH |
585
|
|
|
|
|
|
|
@@ -58,6 +58,10 @@ case $PERL_CONFIG_SH in |
586
|
|
|
|
|
|
|
;; |
587
|
|
|
|
|
|
|
esac |
588
|
|
|
|
|
|
|
|
589
|
|
|
|
|
|
|
+# Avoid localized gcc/cc messages |
590
|
|
|
|
|
|
|
+LC_ALL=C |
591
|
|
|
|
|
|
|
+export LC_ALL |
592
|
|
|
|
|
|
|
+ |
593
|
|
|
|
|
|
|
# We need .. when we are in the x2p directory if we are using the |
594
|
|
|
|
|
|
|
# cppstdin wrapper script. |
595
|
|
|
|
|
|
|
# Put .. and . first so that we pick up the present cppstdin, not |
596
|
|
|
|
|
|
|
END |
597
|
|
|
|
|
|
|
} |
598
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
|
600
|
|
|
|
|
|
|
sub _patch_makedepend_SH |
601
|
|
|
|
|
|
|
{ |
602
|
0
|
|
|
0
|
|
|
my $perl = shift; |
603
|
|
|
|
|
|
|
SWITCH: { |
604
|
|
|
|
|
|
|
# If 5.6.0 |
605
|
0
|
0
|
|
|
|
|
if ( $perl eq '5.6.0' ) { |
|
0
|
|
|
|
|
|
|
606
|
0
|
|
|
|
|
|
_patch(<<'BADGER'); |
607
|
|
|
|
|
|
|
--- makedepend.SH.org 2000-03-02 18:12:26.000000000 +0000 |
608
|
|
|
|
|
|
|
+++ makedepend.SH 2010-09-01 10:13:37.000000000 +0100 |
609
|
|
|
|
|
|
|
@@ -1,5 +1,5 @@ |
610
|
|
|
|
|
|
|
#! /bin/sh |
611
|
|
|
|
|
|
|
-case $CONFIGDOTSH in |
612
|
|
|
|
|
|
|
+case $PERL_CONFIG_SH in |
613
|
|
|
|
|
|
|
'') |
614
|
|
|
|
|
|
|
if test -f config.sh; then TOP=.; |
615
|
|
|
|
|
|
|
elif test -f ../config.sh; then TOP=..; |
616
|
|
|
|
|
|
|
@@ -29,6 +29,13 @@ |
617
|
|
|
|
|
|
|
!GROK!THIS! |
618
|
|
|
|
|
|
|
$spitshell >>makedepend <<'!NO!SUBS!' |
619
|
|
|
|
|
|
|
|
620
|
|
|
|
|
|
|
+if test -d .depending; then |
621
|
|
|
|
|
|
|
+ echo "$0: Already running, exiting." |
622
|
|
|
|
|
|
|
+ exit 0 |
623
|
|
|
|
|
|
|
+fi |
624
|
|
|
|
|
|
|
+ |
625
|
|
|
|
|
|
|
+mkdir .depending |
626
|
|
|
|
|
|
|
+ |
627
|
|
|
|
|
|
|
# This script should be called with |
628
|
|
|
|
|
|
|
# sh ./makedepend MAKE=$(MAKE) |
629
|
|
|
|
|
|
|
case "$1" in |
630
|
|
|
|
|
|
|
@@ -37,7 +44,7 @@ |
631
|
|
|
|
|
|
|
|
632
|
|
|
|
|
|
|
export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh \$0; kill \$\$) |
633
|
|
|
|
|
|
|
|
634
|
|
|
|
|
|
|
-case $CONFIGDOTSH in |
635
|
|
|
|
|
|
|
+case $PERL_CONFIG_SH in |
636
|
|
|
|
|
|
|
'') |
637
|
|
|
|
|
|
|
if test -f config.sh; then TOP=.; |
638
|
|
|
|
|
|
|
elif test -f ../config.sh; then TOP=..; |
639
|
|
|
|
|
|
|
@@ -51,6 +58,11 @@ |
640
|
|
|
|
|
|
|
;; |
641
|
|
|
|
|
|
|
esac |
642
|
|
|
|
|
|
|
|
643
|
|
|
|
|
|
|
+# Avoid localized gcc messages |
644
|
|
|
|
|
|
|
+case "$ccname" in |
645
|
|
|
|
|
|
|
+ gcc) LC_ALL=C ; export LC_ALL ;; |
646
|
|
|
|
|
|
|
+esac |
647
|
|
|
|
|
|
|
+ |
648
|
|
|
|
|
|
|
# We need .. when we are in the x2p directory if we are using the |
649
|
|
|
|
|
|
|
# cppstdin wrapper script. |
650
|
|
|
|
|
|
|
# Put .. and . first so that we pick up the present cppstdin, not |
651
|
|
|
|
|
|
|
@@ -58,6 +70,10 @@ |
652
|
|
|
|
|
|
|
PATH=".$path_sep..$path_sep$PATH" |
653
|
|
|
|
|
|
|
export PATH |
654
|
|
|
|
|
|
|
|
655
|
|
|
|
|
|
|
+case "$osname" in |
656
|
|
|
|
|
|
|
+amigaos) cat=/bin/cat ;; # must be absolute |
657
|
|
|
|
|
|
|
+esac |
658
|
|
|
|
|
|
|
+ |
659
|
|
|
|
|
|
|
$cat /dev/null >.deptmp |
660
|
|
|
|
|
|
|
$rm -f *.c.c c/*.c.c |
661
|
|
|
|
|
|
|
if test -f Makefile; then |
662
|
|
|
|
|
|
|
@@ -67,7 +83,6 @@ |
663
|
|
|
|
|
|
|
# to be out of date. I don't know if OS/2 has touch, so do this: |
664
|
|
|
|
|
|
|
case "$osname" in |
665
|
|
|
|
|
|
|
os2) ;; |
666
|
|
|
|
|
|
|
- netbsd) ;; |
667
|
|
|
|
|
|
|
*) $touch $firstmakefile ;; |
668
|
|
|
|
|
|
|
esac |
669
|
|
|
|
|
|
|
fi |
670
|
|
|
|
|
|
|
@@ -99,25 +114,20 @@ |
671
|
|
|
|
|
|
|
$echo *.c | $tr ' ' $trnl | $egrep -v '\*' >.clist) |
672
|
|
|
|
|
|
|
for file in `$cat .clist`; do |
673
|
|
|
|
|
|
|
# for file in `cat /dev/null`; do |
674
|
|
|
|
|
|
|
- if [ "$osname" = uwin ]; then |
675
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g -e s,\\([a-zA-Z]\\):/,/\\1/,g" |
676
|
|
|
|
|
|
|
- else |
677
|
|
|
|
|
|
|
- if [ "$osname" = os2 ]; then |
678
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g" |
679
|
|
|
|
|
|
|
- else |
680
|
|
|
|
|
|
|
- if [ "$archname" = cygwin ]; then |
681
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g" |
682
|
|
|
|
|
|
|
- else |
683
|
|
|
|
|
|
|
- uwinfix= |
684
|
|
|
|
|
|
|
- fi |
685
|
|
|
|
|
|
|
- fi |
686
|
|
|
|
|
|
|
- fi |
687
|
|
|
|
|
|
|
+ case "$osname" in |
688
|
|
|
|
|
|
|
+ uwin) uwinfix="-e s,\\\\\\\\,/,g -e s,\\([a-zA-Z]\\):/,/\\1/,g" ;; |
689
|
|
|
|
|
|
|
+ os2) uwinfix="-e s,\\\\\\\\,/,g" ;; |
690
|
|
|
|
|
|
|
+ cygwin) uwinfix="-e s,\\\\\\\\,/,g" ;; |
691
|
|
|
|
|
|
|
+ posix-bc) uwinfix="-e s/\\*POSIX(\\(.*\\))/\\1/" ;; |
692
|
|
|
|
|
|
|
+ vos) uwinfix="-e s/\#/\\\#/" ;; |
693
|
|
|
|
|
|
|
+ *) uwinfix="" ;; |
694
|
|
|
|
|
|
|
+ esac |
695
|
|
|
|
|
|
|
case "$file" in |
696
|
|
|
|
|
|
|
*.c) filebase=`basename $file .c` ;; |
697
|
|
|
|
|
|
|
*.y) filebase=`basename $file .y` ;; |
698
|
|
|
|
|
|
|
esac |
699
|
|
|
|
|
|
|
case "$file" in |
700
|
|
|
|
|
|
|
- */*) finc="-I`echo $file | sed 's#/[^/]*$##`" ;; |
701
|
|
|
|
|
|
|
+ */*) finc="-I`echo $file | sed 's#/[^/]*$##'`" ;; |
702
|
|
|
|
|
|
|
*) finc= ;; |
703
|
|
|
|
|
|
|
esac |
704
|
|
|
|
|
|
|
$echo "Finding dependencies for $filebase$_o." |
705
|
|
|
|
|
|
|
@@ -130,22 +140,45 @@ |
706
|
|
|
|
|
|
|
-e 's|\\$||' \ |
707
|
|
|
|
|
|
|
-e p \ |
708
|
|
|
|
|
|
|
-e '}' ) >UU/$file.c |
709
|
|
|
|
|
|
|
+ |
710
|
|
|
|
|
|
|
if [ "$osname" = os390 -a "$file" = perly.c ]; then |
711
|
|
|
|
|
|
|
$echo '#endif' >>UU/$file.c |
712
|
|
|
|
|
|
|
fi |
713
|
|
|
|
|
|
|
- $cppstdin $finc -I. $cppflags $cppminus
|
714
|
|
|
|
|
|
|
- $sed \ |
715
|
|
|
|
|
|
|
- -e '1d' \ |
716
|
|
|
|
|
|
|
- -e '/^#.*/d' \ |
717
|
|
|
|
|
|
|
- -e '/^#.*"-"/d' \ |
718
|
|
|
|
|
|
|
- -e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ |
719
|
|
|
|
|
|
|
- -e 's/^[ ]*#[ ]*line/#/' \ |
720
|
|
|
|
|
|
|
- -e '/^# *[0-9][0-9]* *[".\/]/!d' \ |
721
|
|
|
|
|
|
|
- -e 's/^.*"\(.*\)".*$/'$filebase'\$(OBJ_EXT): \1/' \ |
722
|
|
|
|
|
|
|
- -e 's/^# *[0-9][0-9]* \(.*\)$/'$filebase'\$(OBJ_EXT): \1/' \ |
723
|
|
|
|
|
|
|
- -e 's|: \./|: |' \ |
724
|
|
|
|
|
|
|
- -e 's|\.c\.c|.c|' $uwinfix | \ |
725
|
|
|
|
|
|
|
- $uniq | $sort | $uniq >> .deptmp |
726
|
|
|
|
|
|
|
+ |
727
|
|
|
|
|
|
|
+ if [ "$osname" = os390 ]; then |
728
|
|
|
|
|
|
|
+ $cppstdin $finc -I. $cppflags $cppminus
|
729
|
|
|
|
|
|
|
+ $sed \ |
730
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
731
|
|
|
|
|
|
|
+ -e '/^#.*"-"/d' \ |
732
|
|
|
|
|
|
|
+ -e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ |
733
|
|
|
|
|
|
|
+ -e 's/^[ ]*#[ ]*line/#/' \ |
734
|
|
|
|
|
|
|
+ -e '/^# *[0-9][0-9]* *[".\/]/!d' \ |
735
|
|
|
|
|
|
|
+ -e 's/^.*"\(.*\)".*$/'$filebase'\$(OBJ_EXT): \1/' \ |
736
|
|
|
|
|
|
|
+ -e 's/^# *[0-9][0-9]* \(.*\)$/'$filebase'\$(OBJ_EXT): \1/' \ |
737
|
|
|
|
|
|
|
+ -e 's|: \./|: |' \ |
738
|
|
|
|
|
|
|
+ -e 's|\.c\.c|.c|' $uwinfix | \ |
739
|
|
|
|
|
|
|
+ $uniq | $sort | $uniq >> .deptmp |
740
|
|
|
|
|
|
|
+ else |
741
|
|
|
|
|
|
|
+ $cppstdin $finc -I. $cppflags $cppminus .cout 2>.cerr |
742
|
|
|
|
|
|
|
+ $sed \ |
743
|
|
|
|
|
|
|
+ -e '1d' \ |
744
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
745
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
746
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
747
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
748
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
749
|
|
|
|
|
|
|
+ -e '/^#.*"-"/d' \ |
750
|
|
|
|
|
|
|
+ -e '/^#.*"\/.*\/"/d' \ |
751
|
|
|
|
|
|
|
+ -e '/: file path prefix .* never used$/d' \ |
752
|
|
|
|
|
|
|
+ -e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ |
753
|
|
|
|
|
|
|
+ -e 's/^[ ]*#[ ]*line/#/' \ |
754
|
|
|
|
|
|
|
+ -e '/^# *[0-9][0-9]* *[".\/]/!d' \ |
755
|
|
|
|
|
|
|
+ -e 's/^.*"\(.*\)".*$/'$filebase'\$(OBJ_EXT): \1/' \ |
756
|
|
|
|
|
|
|
+ -e 's/^# *[0-9][0-9]* \(.*\)$/'$filebase'\$(OBJ_EXT): \1/' \ |
757
|
|
|
|
|
|
|
+ -e 's|: \./|: |' \ |
758
|
|
|
|
|
|
|
+ -e 's|\.c\.c|.c|' $uwinfix .cout .cerr| \ |
759
|
|
|
|
|
|
|
+ $uniq | $sort | $uniq >> .deptmp |
760
|
|
|
|
|
|
|
+ fi |
761
|
|
|
|
|
|
|
done |
762
|
|
|
|
|
|
|
|
763
|
|
|
|
|
|
|
$sed <$mf >$mf.new -e '1,/^# AUTOMATICALLY/!d' |
764
|
|
|
|
|
|
|
@@ -177,6 +210,10 @@ |
765
|
|
|
|
|
|
|
$echo "Updating $mf..." |
766
|
|
|
|
|
|
|
$echo "# If this runs make out of memory, delete /usr/include lines." \ |
767
|
|
|
|
|
|
|
>> $mf.new |
768
|
|
|
|
|
|
|
+ if [ "$osname" = vos ]; then |
769
|
|
|
|
|
|
|
+ $sed 's|.incl.c|.h|' .deptmp >.deptmp.vos |
770
|
|
|
|
|
|
|
+ mv -f .deptmp.vos .deptmp |
771
|
|
|
|
|
|
|
+ fi |
772
|
|
|
|
|
|
|
$sed 's|^\(.*\$(OBJ_EXT):\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" .deptmp \ |
773
|
|
|
|
|
|
|
>>$mf.new |
774
|
|
|
|
|
|
|
else |
775
|
|
|
|
|
|
|
@@ -208,7 +245,8 @@ |
776
|
|
|
|
|
|
|
$cp $mf.new $mf |
777
|
|
|
|
|
|
|
$rm $mf.new |
778
|
|
|
|
|
|
|
$echo "# WARNING: Put nothing here or make depend will gobble it up!" >> $mf |
779
|
|
|
|
|
|
|
-$rm -rf .deptmp UU .shlist .clist .hlist .hsed |
780
|
|
|
|
|
|
|
+$rm -rf .deptmp UU .shlist .clist .hlist .hsed .cout .cerr |
781
|
|
|
|
|
|
|
+rmdir .depending |
782
|
|
|
|
|
|
|
|
783
|
|
|
|
|
|
|
!NO!SUBS! |
784
|
|
|
|
|
|
|
$eunicefix makedepend |
785
|
|
|
|
|
|
|
BADGER |
786
|
0
|
|
|
|
|
|
last SWITCH; |
787
|
|
|
|
|
|
|
} |
788
|
|
|
|
|
|
|
# If 5.6.1 |
789
|
0
|
0
|
|
|
|
|
if ( $perl eq '5.6.1' ) { |
790
|
0
|
|
|
|
|
|
_patch(<<'BADGER'); |
791
|
|
|
|
|
|
|
--- makedepend.SH.org 2001-03-19 07:33:17.000000000 +0000 |
792
|
|
|
|
|
|
|
+++ makedepend.SH 2010-09-01 10:14:47.000000000 +0100 |
793
|
|
|
|
|
|
|
@@ -1,5 +1,5 @@ |
794
|
|
|
|
|
|
|
#! /bin/sh |
795
|
|
|
|
|
|
|
-case $CONFIGDOTSH in |
796
|
|
|
|
|
|
|
+case $PERL_CONFIG_SH in |
797
|
|
|
|
|
|
|
'') |
798
|
|
|
|
|
|
|
if test -f config.sh; then TOP=.; |
799
|
|
|
|
|
|
|
elif test -f ../config.sh; then TOP=..; |
800
|
|
|
|
|
|
|
@@ -29,6 +29,13 @@ |
801
|
|
|
|
|
|
|
!GROK!THIS! |
802
|
|
|
|
|
|
|
$spitshell >>makedepend <<'!NO!SUBS!' |
803
|
|
|
|
|
|
|
|
804
|
|
|
|
|
|
|
+if test -d .depending; then |
805
|
|
|
|
|
|
|
+ echo "$0: Already running, exiting." |
806
|
|
|
|
|
|
|
+ exit 0 |
807
|
|
|
|
|
|
|
+fi |
808
|
|
|
|
|
|
|
+ |
809
|
|
|
|
|
|
|
+mkdir .depending |
810
|
|
|
|
|
|
|
+ |
811
|
|
|
|
|
|
|
# This script should be called with |
812
|
|
|
|
|
|
|
# sh ./makedepend MAKE=$(MAKE) |
813
|
|
|
|
|
|
|
case "$1" in |
814
|
|
|
|
|
|
|
@@ -37,7 +44,7 @@ |
815
|
|
|
|
|
|
|
|
816
|
|
|
|
|
|
|
export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh \$0; kill \$\$) |
817
|
|
|
|
|
|
|
|
818
|
|
|
|
|
|
|
-case $CONFIGDOTSH in |
819
|
|
|
|
|
|
|
+case $PERL_CONFIG_SH in |
820
|
|
|
|
|
|
|
'') |
821
|
|
|
|
|
|
|
if test -f config.sh; then TOP=.; |
822
|
|
|
|
|
|
|
elif test -f ../config.sh; then TOP=..; |
823
|
|
|
|
|
|
|
@@ -51,6 +58,11 @@ |
824
|
|
|
|
|
|
|
;; |
825
|
|
|
|
|
|
|
esac |
826
|
|
|
|
|
|
|
|
827
|
|
|
|
|
|
|
+# Avoid localized gcc messages |
828
|
|
|
|
|
|
|
+case "$ccname" in |
829
|
|
|
|
|
|
|
+ gcc) LC_ALL=C ; export LC_ALL ;; |
830
|
|
|
|
|
|
|
+esac |
831
|
|
|
|
|
|
|
+ |
832
|
|
|
|
|
|
|
# We need .. when we are in the x2p directory if we are using the |
833
|
|
|
|
|
|
|
# cppstdin wrapper script. |
834
|
|
|
|
|
|
|
# Put .. and . first so that we pick up the present cppstdin, not |
835
|
|
|
|
|
|
|
@@ -58,6 +70,10 @@ |
836
|
|
|
|
|
|
|
PATH=".$path_sep..$path_sep$PATH" |
837
|
|
|
|
|
|
|
export PATH |
838
|
|
|
|
|
|
|
|
839
|
|
|
|
|
|
|
+case "$osname" in |
840
|
|
|
|
|
|
|
+amigaos) cat=/bin/cat ;; # must be absolute |
841
|
|
|
|
|
|
|
+esac |
842
|
|
|
|
|
|
|
+ |
843
|
|
|
|
|
|
|
$cat /dev/null >.deptmp |
844
|
|
|
|
|
|
|
$rm -f *.c.c c/*.c.c |
845
|
|
|
|
|
|
|
if test -f Makefile; then |
846
|
|
|
|
|
|
|
@@ -67,7 +83,6 @@ |
847
|
|
|
|
|
|
|
# to be out of date. I don't know if OS/2 has touch, so do this: |
848
|
|
|
|
|
|
|
case "$osname" in |
849
|
|
|
|
|
|
|
os2) ;; |
850
|
|
|
|
|
|
|
- netbsd) ;; |
851
|
|
|
|
|
|
|
*) $touch $firstmakefile ;; |
852
|
|
|
|
|
|
|
esac |
853
|
|
|
|
|
|
|
fi |
854
|
|
|
|
|
|
|
@@ -99,29 +114,20 @@ |
855
|
|
|
|
|
|
|
$echo *.c | $tr ' ' $trnl | $egrep -v '\*' >.clist) |
856
|
|
|
|
|
|
|
for file in `$cat .clist`; do |
857
|
|
|
|
|
|
|
# for file in `cat /dev/null`; do |
858
|
|
|
|
|
|
|
- if [ "$osname" = uwin ]; then |
859
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g -e s,\\([a-zA-Z]\\):/,/\\1/,g" |
860
|
|
|
|
|
|
|
- else |
861
|
|
|
|
|
|
|
- if [ "$osname" = os2 ]; then |
862
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g" |
863
|
|
|
|
|
|
|
- else |
864
|
|
|
|
|
|
|
- if [ "$archname" = cygwin ]; then |
865
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g" |
866
|
|
|
|
|
|
|
- else |
867
|
|
|
|
|
|
|
- if [ "$osname" = posix-bc ]; then |
868
|
|
|
|
|
|
|
- uwinfix="-e s/\\*POSIX(\\(.*\\))/\\1/" |
869
|
|
|
|
|
|
|
- else |
870
|
|
|
|
|
|
|
- uwinfix= |
871
|
|
|
|
|
|
|
- fi |
872
|
|
|
|
|
|
|
- fi |
873
|
|
|
|
|
|
|
- fi |
874
|
|
|
|
|
|
|
- fi |
875
|
|
|
|
|
|
|
+ case "$osname" in |
876
|
|
|
|
|
|
|
+ uwin) uwinfix="-e s,\\\\\\\\,/,g -e s,\\([a-zA-Z]\\):/,/\\1/,g" ;; |
877
|
|
|
|
|
|
|
+ os2) uwinfix="-e s,\\\\\\\\,/,g" ;; |
878
|
|
|
|
|
|
|
+ cygwin) uwinfix="-e s,\\\\\\\\,/,g" ;; |
879
|
|
|
|
|
|
|
+ posix-bc) uwinfix="-e s/\\*POSIX(\\(.*\\))/\\1/" ;; |
880
|
|
|
|
|
|
|
+ vos) uwinfix="-e s/\#/\\\#/" ;; |
881
|
|
|
|
|
|
|
+ *) uwinfix="" ;; |
882
|
|
|
|
|
|
|
+ esac |
883
|
|
|
|
|
|
|
case "$file" in |
884
|
|
|
|
|
|
|
*.c) filebase=`basename $file .c` ;; |
885
|
|
|
|
|
|
|
*.y) filebase=`basename $file .y` ;; |
886
|
|
|
|
|
|
|
esac |
887
|
|
|
|
|
|
|
case "$file" in |
888
|
|
|
|
|
|
|
- */*) finc="-I`echo $file | sed 's#/[^/]*$##`" ;; |
889
|
|
|
|
|
|
|
+ */*) finc="-I`echo $file | sed 's#/[^/]*$##'`" ;; |
890
|
|
|
|
|
|
|
*) finc= ;; |
891
|
|
|
|
|
|
|
esac |
892
|
|
|
|
|
|
|
$echo "Finding dependencies for $filebase$_o." |
893
|
|
|
|
|
|
|
@@ -134,10 +140,12 @@ |
894
|
|
|
|
|
|
|
-e 's|\\$||' \ |
895
|
|
|
|
|
|
|
-e p \ |
896
|
|
|
|
|
|
|
-e '}' ) >UU/$file.c |
897
|
|
|
|
|
|
|
+ |
898
|
|
|
|
|
|
|
+ if [ "$osname" = os390 -a "$file" = perly.c ]; then |
899
|
|
|
|
|
|
|
+ $echo '#endif' >>UU/$file.c |
900
|
|
|
|
|
|
|
+ fi |
901
|
|
|
|
|
|
|
+ |
902
|
|
|
|
|
|
|
if [ "$osname" = os390 ]; then |
903
|
|
|
|
|
|
|
- if [ "$file" = perly.c ]; then |
904
|
|
|
|
|
|
|
- $echo '#endif' >>UU/$file.c |
905
|
|
|
|
|
|
|
- fi |
906
|
|
|
|
|
|
|
$cppstdin $finc -I. $cppflags $cppminus
|
907
|
|
|
|
|
|
|
$sed \ |
908
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
909
|
|
|
|
|
|
|
@@ -151,18 +159,24 @@ |
910
|
|
|
|
|
|
|
-e 's|\.c\.c|.c|' $uwinfix | \ |
911
|
|
|
|
|
|
|
$uniq | $sort | $uniq >> .deptmp |
912
|
|
|
|
|
|
|
else |
913
|
|
|
|
|
|
|
- $cppstdin $finc -I. $cppflags $cppminus
|
914
|
|
|
|
|
|
|
+ $cppstdin $finc -I. $cppflags $cppminus .cout 2>.cerr |
915
|
|
|
|
|
|
|
$sed \ |
916
|
|
|
|
|
|
|
-e '1d' \ |
917
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
918
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
919
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
920
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
921
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
922
|
|
|
|
|
|
|
-e '/^#.*"-"/d' \ |
923
|
|
|
|
|
|
|
+ -e '/^#.*"\/.*\/"/d' \ |
924
|
|
|
|
|
|
|
+ -e '/: file path prefix .* never used$/d' \ |
925
|
|
|
|
|
|
|
-e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ |
926
|
|
|
|
|
|
|
-e 's/^[ ]*#[ ]*line/#/' \ |
927
|
|
|
|
|
|
|
-e '/^# *[0-9][0-9]* *[".\/]/!d' \ |
928
|
|
|
|
|
|
|
-e 's/^.*"\(.*\)".*$/'$filebase'\$(OBJ_EXT): \1/' \ |
929
|
|
|
|
|
|
|
-e 's/^# *[0-9][0-9]* \(.*\)$/'$filebase'\$(OBJ_EXT): \1/' \ |
930
|
|
|
|
|
|
|
-e 's|: \./|: |' \ |
931
|
|
|
|
|
|
|
- -e 's|\.c\.c|.c|' $uwinfix | \ |
932
|
|
|
|
|
|
|
+ -e 's|\.c\.c|.c|' $uwinfix .cout .cerr| \ |
933
|
|
|
|
|
|
|
$uniq | $sort | $uniq >> .deptmp |
934
|
|
|
|
|
|
|
fi |
935
|
|
|
|
|
|
|
done |
936
|
|
|
|
|
|
|
@@ -196,6 +210,10 @@ |
937
|
|
|
|
|
|
|
$echo "Updating $mf..." |
938
|
|
|
|
|
|
|
$echo "# If this runs make out of memory, delete /usr/include lines." \ |
939
|
|
|
|
|
|
|
>> $mf.new |
940
|
|
|
|
|
|
|
+ if [ "$osname" = vos ]; then |
941
|
|
|
|
|
|
|
+ $sed 's|.incl.c|.h|' .deptmp >.deptmp.vos |
942
|
|
|
|
|
|
|
+ mv -f .deptmp.vos .deptmp |
943
|
|
|
|
|
|
|
+ fi |
944
|
|
|
|
|
|
|
$sed 's|^\(.*\$(OBJ_EXT):\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" .deptmp \ |
945
|
|
|
|
|
|
|
>>$mf.new |
946
|
|
|
|
|
|
|
else |
947
|
|
|
|
|
|
|
@@ -227,7 +245,8 @@ |
948
|
|
|
|
|
|
|
$cp $mf.new $mf |
949
|
|
|
|
|
|
|
$rm $mf.new |
950
|
|
|
|
|
|
|
$echo "# WARNING: Put nothing here or make depend will gobble it up!" >> $mf |
951
|
|
|
|
|
|
|
-$rm -rf .deptmp UU .shlist .clist .hlist .hsed |
952
|
|
|
|
|
|
|
+$rm -rf .deptmp UU .shlist .clist .hlist .hsed .cout .cerr |
953
|
|
|
|
|
|
|
+rmdir .depending |
954
|
|
|
|
|
|
|
|
955
|
|
|
|
|
|
|
!NO!SUBS! |
956
|
|
|
|
|
|
|
$eunicefix makedepend |
957
|
|
|
|
|
|
|
BADGER |
958
|
0
|
|
|
|
|
|
last SWITCH; |
959
|
|
|
|
|
|
|
} |
960
|
|
|
|
|
|
|
# If 5.6.2 |
961
|
0
|
0
|
|
|
|
|
if ( $perl eq '5.6.2' ) { |
962
|
0
|
|
|
|
|
|
_patch(<<'BADGER'); |
963
|
|
|
|
|
|
|
--- makedepend.SH.org 2003-07-30 23:46:59.000000000 +0100 |
964
|
|
|
|
|
|
|
+++ makedepend.SH 2010-09-01 10:15:47.000000000 +0100 |
965
|
|
|
|
|
|
|
@@ -1,5 +1,5 @@ |
966
|
|
|
|
|
|
|
#! /bin/sh |
967
|
|
|
|
|
|
|
-case $CONFIGDOTSH in |
968
|
|
|
|
|
|
|
+case $PERL_CONFIG_SH in |
969
|
|
|
|
|
|
|
'') |
970
|
|
|
|
|
|
|
if test -f config.sh; then TOP=.; |
971
|
|
|
|
|
|
|
elif test -f ../config.sh; then TOP=..; |
972
|
|
|
|
|
|
|
@@ -29,6 +29,13 @@ |
973
|
|
|
|
|
|
|
!GROK!THIS! |
974
|
|
|
|
|
|
|
$spitshell >>makedepend <<'!NO!SUBS!' |
975
|
|
|
|
|
|
|
|
976
|
|
|
|
|
|
|
+if test -d .depending; then |
977
|
|
|
|
|
|
|
+ echo "$0: Already running, exiting." |
978
|
|
|
|
|
|
|
+ exit 0 |
979
|
|
|
|
|
|
|
+fi |
980
|
|
|
|
|
|
|
+ |
981
|
|
|
|
|
|
|
+mkdir .depending |
982
|
|
|
|
|
|
|
+ |
983
|
|
|
|
|
|
|
# This script should be called with |
984
|
|
|
|
|
|
|
# sh ./makedepend MAKE=$(MAKE) |
985
|
|
|
|
|
|
|
case "$1" in |
986
|
|
|
|
|
|
|
@@ -37,7 +44,7 @@ |
987
|
|
|
|
|
|
|
|
988
|
|
|
|
|
|
|
export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh \$0; kill \$\$) |
989
|
|
|
|
|
|
|
|
990
|
|
|
|
|
|
|
-case $CONFIGDOTSH in |
991
|
|
|
|
|
|
|
+case $PERL_CONFIG_SH in |
992
|
|
|
|
|
|
|
'') |
993
|
|
|
|
|
|
|
if test -f config.sh; then TOP=.; |
994
|
|
|
|
|
|
|
elif test -f ../config.sh; then TOP=..; |
995
|
|
|
|
|
|
|
@@ -63,6 +70,10 @@ |
996
|
|
|
|
|
|
|
PATH=".$path_sep..$path_sep$PATH" |
997
|
|
|
|
|
|
|
export PATH |
998
|
|
|
|
|
|
|
|
999
|
|
|
|
|
|
|
+case "$osname" in |
1000
|
|
|
|
|
|
|
+amigaos) cat=/bin/cat ;; # must be absolute |
1001
|
|
|
|
|
|
|
+esac |
1002
|
|
|
|
|
|
|
+ |
1003
|
|
|
|
|
|
|
$cat /dev/null >.deptmp |
1004
|
|
|
|
|
|
|
$rm -f *.c.c c/*.c.c |
1005
|
|
|
|
|
|
|
if test -f Makefile; then |
1006
|
|
|
|
|
|
|
@@ -72,7 +83,6 @@ |
1007
|
|
|
|
|
|
|
# to be out of date. I don't know if OS/2 has touch, so do this: |
1008
|
|
|
|
|
|
|
case "$osname" in |
1009
|
|
|
|
|
|
|
os2) ;; |
1010
|
|
|
|
|
|
|
- netbsd) ;; |
1011
|
|
|
|
|
|
|
*) $touch $firstmakefile ;; |
1012
|
|
|
|
|
|
|
esac |
1013
|
|
|
|
|
|
|
fi |
1014
|
|
|
|
|
|
|
@@ -104,29 +114,20 @@ |
1015
|
|
|
|
|
|
|
$echo *.c | $tr ' ' $trnl | $egrep -v '\*' >.clist) |
1016
|
|
|
|
|
|
|
for file in `$cat .clist`; do |
1017
|
|
|
|
|
|
|
# for file in `cat /dev/null`; do |
1018
|
|
|
|
|
|
|
- if [ "$osname" = uwin ]; then |
1019
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g -e s,\\([a-zA-Z]\\):/,/\\1/,g" |
1020
|
|
|
|
|
|
|
- else |
1021
|
|
|
|
|
|
|
- if [ "$osname" = os2 ]; then |
1022
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g" |
1023
|
|
|
|
|
|
|
- else |
1024
|
|
|
|
|
|
|
- if [ "$archname" = cygwin ]; then |
1025
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g" |
1026
|
|
|
|
|
|
|
- else |
1027
|
|
|
|
|
|
|
- if [ "$osname" = posix-bc ]; then |
1028
|
|
|
|
|
|
|
- uwinfix="-e s/\\*POSIX(\\(.*\\))/\\1/" |
1029
|
|
|
|
|
|
|
- else |
1030
|
|
|
|
|
|
|
- uwinfix= |
1031
|
|
|
|
|
|
|
- fi |
1032
|
|
|
|
|
|
|
- fi |
1033
|
|
|
|
|
|
|
- fi |
1034
|
|
|
|
|
|
|
- fi |
1035
|
|
|
|
|
|
|
+ case "$osname" in |
1036
|
|
|
|
|
|
|
+ uwin) uwinfix="-e s,\\\\\\\\,/,g -e s,\\([a-zA-Z]\\):/,/\\1/,g" ;; |
1037
|
|
|
|
|
|
|
+ os2) uwinfix="-e s,\\\\\\\\,/,g" ;; |
1038
|
|
|
|
|
|
|
+ cygwin) uwinfix="-e s,\\\\\\\\,/,g" ;; |
1039
|
|
|
|
|
|
|
+ posix-bc) uwinfix="-e s/\\*POSIX(\\(.*\\))/\\1/" ;; |
1040
|
|
|
|
|
|
|
+ vos) uwinfix="-e s/\#/\\\#/" ;; |
1041
|
|
|
|
|
|
|
+ *) uwinfix="" ;; |
1042
|
|
|
|
|
|
|
+ esac |
1043
|
|
|
|
|
|
|
case "$file" in |
1044
|
|
|
|
|
|
|
*.c) filebase=`basename $file .c` ;; |
1045
|
|
|
|
|
|
|
*.y) filebase=`basename $file .y` ;; |
1046
|
|
|
|
|
|
|
esac |
1047
|
|
|
|
|
|
|
case "$file" in |
1048
|
|
|
|
|
|
|
- */*) finc="-I`echo $file | sed 's#/[^/]*$##`" ;; |
1049
|
|
|
|
|
|
|
+ */*) finc="-I`echo $file | sed 's#/[^/]*$##'`" ;; |
1050
|
|
|
|
|
|
|
*) finc= ;; |
1051
|
|
|
|
|
|
|
esac |
1052
|
|
|
|
|
|
|
$echo "Finding dependencies for $filebase$_o." |
1053
|
|
|
|
|
|
|
@@ -139,10 +140,12 @@ |
1054
|
|
|
|
|
|
|
-e 's|\\$||' \ |
1055
|
|
|
|
|
|
|
-e p \ |
1056
|
|
|
|
|
|
|
-e '}' ) >UU/$file.c |
1057
|
|
|
|
|
|
|
+ |
1058
|
|
|
|
|
|
|
+ if [ "$osname" = os390 -a "$file" = perly.c ]; then |
1059
|
|
|
|
|
|
|
+ $echo '#endif' >>UU/$file.c |
1060
|
|
|
|
|
|
|
+ fi |
1061
|
|
|
|
|
|
|
+ |
1062
|
|
|
|
|
|
|
if [ "$osname" = os390 ]; then |
1063
|
|
|
|
|
|
|
- if [ "$file" = perly.c ]; then |
1064
|
|
|
|
|
|
|
- $echo '#endif' >>UU/$file.c |
1065
|
|
|
|
|
|
|
- fi |
1066
|
|
|
|
|
|
|
$cppstdin $finc -I. $cppflags $cppminus
|
1067
|
|
|
|
|
|
|
$sed \ |
1068
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
1069
|
|
|
|
|
|
|
@@ -156,21 +159,24 @@ |
1070
|
|
|
|
|
|
|
-e 's|\.c\.c|.c|' $uwinfix | \ |
1071
|
|
|
|
|
|
|
$uniq | $sort | $uniq >> .deptmp |
1072
|
|
|
|
|
|
|
else |
1073
|
|
|
|
|
|
|
- $cppstdin $finc -I. $cppflags $cppminus
|
1074
|
|
|
|
|
|
|
+ $cppstdin $finc -I. $cppflags $cppminus .cout 2>.cerr |
1075
|
|
|
|
|
|
|
$sed \ |
1076
|
|
|
|
|
|
|
-e '1d' \ |
1077
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
1078
|
|
|
|
|
|
|
- -e '/^#.*/d' \ |
1079
|
|
|
|
|
|
|
- -e '/^#.*/d' \ |
1080
|
|
|
|
|
|
|
- -e '/^#.*/d' \ |
1081
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1082
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1083
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1084
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1085
|
|
|
|
|
|
|
-e '/^#.*"-"/d' \ |
1086
|
|
|
|
|
|
|
+ -e '/^#.*"\/.*\/"/d' \ |
1087
|
|
|
|
|
|
|
+ -e '/: file path prefix .* never used$/d' \ |
1088
|
|
|
|
|
|
|
-e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ |
1089
|
|
|
|
|
|
|
-e 's/^[ ]*#[ ]*line/#/' \ |
1090
|
|
|
|
|
|
|
-e '/^# *[0-9][0-9]* *[".\/]/!d' \ |
1091
|
|
|
|
|
|
|
-e 's/^.*"\(.*\)".*$/'$filebase'\$(OBJ_EXT): \1/' \ |
1092
|
|
|
|
|
|
|
-e 's/^# *[0-9][0-9]* \(.*\)$/'$filebase'\$(OBJ_EXT): \1/' \ |
1093
|
|
|
|
|
|
|
-e 's|: \./|: |' \ |
1094
|
|
|
|
|
|
|
- -e 's|\.c\.c|.c|' $uwinfix | \ |
1095
|
|
|
|
|
|
|
+ -e 's|\.c\.c|.c|' $uwinfix .cout .cerr| \ |
1096
|
|
|
|
|
|
|
$uniq | $sort | $uniq >> .deptmp |
1097
|
|
|
|
|
|
|
fi |
1098
|
|
|
|
|
|
|
done |
1099
|
|
|
|
|
|
|
@@ -204,6 +210,10 @@ |
1100
|
|
|
|
|
|
|
$echo "Updating $mf..." |
1101
|
|
|
|
|
|
|
$echo "# If this runs make out of memory, delete /usr/include lines." \ |
1102
|
|
|
|
|
|
|
>> $mf.new |
1103
|
|
|
|
|
|
|
+ if [ "$osname" = vos ]; then |
1104
|
|
|
|
|
|
|
+ $sed 's|.incl.c|.h|' .deptmp >.deptmp.vos |
1105
|
|
|
|
|
|
|
+ mv -f .deptmp.vos .deptmp |
1106
|
|
|
|
|
|
|
+ fi |
1107
|
|
|
|
|
|
|
$sed 's|^\(.*\$(OBJ_EXT):\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" .deptmp \ |
1108
|
|
|
|
|
|
|
>>$mf.new |
1109
|
|
|
|
|
|
|
else |
1110
|
|
|
|
|
|
|
@@ -235,7 +245,8 @@ |
1111
|
|
|
|
|
|
|
$cp $mf.new $mf |
1112
|
|
|
|
|
|
|
$rm $mf.new |
1113
|
|
|
|
|
|
|
$echo "# WARNING: Put nothing here or make depend will gobble it up!" >> $mf |
1114
|
|
|
|
|
|
|
-$rm -rf .deptmp UU .shlist .clist .hlist .hsed |
1115
|
|
|
|
|
|
|
+$rm -rf .deptmp UU .shlist .clist .hlist .hsed .cout .cerr |
1116
|
|
|
|
|
|
|
+rmdir .depending |
1117
|
|
|
|
|
|
|
|
1118
|
|
|
|
|
|
|
!NO!SUBS! |
1119
|
|
|
|
|
|
|
$eunicefix makedepend |
1120
|
|
|
|
|
|
|
BADGER |
1121
|
0
|
|
|
|
|
|
last SWITCH; |
1122
|
|
|
|
|
|
|
} |
1123
|
|
|
|
|
|
|
# If 5.7.0 |
1124
|
0
|
0
|
|
|
|
|
if ( $perl eq '5.7.0' ) { |
1125
|
0
|
|
|
|
|
|
_patch(<<'BADGER'); |
1126
|
|
|
|
|
|
|
--- makedepend.SH.org 2000-08-13 19:35:04.000000000 +0100 |
1127
|
|
|
|
|
|
|
+++ makedepend.SH 2010-09-01 10:47:14.000000000 +0100 |
1128
|
|
|
|
|
|
|
@@ -1,5 +1,5 @@ |
1129
|
|
|
|
|
|
|
#! /bin/sh |
1130
|
|
|
|
|
|
|
-case $CONFIGDOTSH in |
1131
|
|
|
|
|
|
|
+case $PERL_CONFIG_SH in |
1132
|
|
|
|
|
|
|
'') |
1133
|
|
|
|
|
|
|
if test -f config.sh; then TOP=.; |
1134
|
|
|
|
|
|
|
elif test -f ../config.sh; then TOP=..; |
1135
|
|
|
|
|
|
|
@@ -29,6 +29,13 @@ |
1136
|
|
|
|
|
|
|
!GROK!THIS! |
1137
|
|
|
|
|
|
|
$spitshell >>makedepend <<'!NO!SUBS!' |
1138
|
|
|
|
|
|
|
|
1139
|
|
|
|
|
|
|
+if test -d .depending; then |
1140
|
|
|
|
|
|
|
+ echo "$0: Already running, exiting." |
1141
|
|
|
|
|
|
|
+ exit 0 |
1142
|
|
|
|
|
|
|
+fi |
1143
|
|
|
|
|
|
|
+ |
1144
|
|
|
|
|
|
|
+mkdir .depending |
1145
|
|
|
|
|
|
|
+ |
1146
|
|
|
|
|
|
|
# This script should be called with |
1147
|
|
|
|
|
|
|
# sh ./makedepend MAKE=$(MAKE) |
1148
|
|
|
|
|
|
|
case "$1" in |
1149
|
|
|
|
|
|
|
@@ -37,7 +44,7 @@ |
1150
|
|
|
|
|
|
|
|
1151
|
|
|
|
|
|
|
export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh \$0; kill \$\$) |
1152
|
|
|
|
|
|
|
|
1153
|
|
|
|
|
|
|
-case $CONFIGDOTSH in |
1154
|
|
|
|
|
|
|
+case $PERL_CONFIG_SH in |
1155
|
|
|
|
|
|
|
'') |
1156
|
|
|
|
|
|
|
if test -f config.sh; then TOP=.; |
1157
|
|
|
|
|
|
|
elif test -f ../config.sh; then TOP=..; |
1158
|
|
|
|
|
|
|
@@ -51,6 +58,11 @@ |
1159
|
|
|
|
|
|
|
;; |
1160
|
|
|
|
|
|
|
esac |
1161
|
|
|
|
|
|
|
|
1162
|
|
|
|
|
|
|
+# Avoid localized gcc messages |
1163
|
|
|
|
|
|
|
+case "$ccname" in |
1164
|
|
|
|
|
|
|
+ gcc) LC_ALL=C ; export LC_ALL ;; |
1165
|
|
|
|
|
|
|
+esac |
1166
|
|
|
|
|
|
|
+ |
1167
|
|
|
|
|
|
|
# We need .. when we are in the x2p directory if we are using the |
1168
|
|
|
|
|
|
|
# cppstdin wrapper script. |
1169
|
|
|
|
|
|
|
# Put .. and . first so that we pick up the present cppstdin, not |
1170
|
|
|
|
|
|
|
@@ -58,6 +70,10 @@ |
1171
|
|
|
|
|
|
|
PATH=".$path_sep..$path_sep$PATH" |
1172
|
|
|
|
|
|
|
export PATH |
1173
|
|
|
|
|
|
|
|
1174
|
|
|
|
|
|
|
+case "$osname" in |
1175
|
|
|
|
|
|
|
+amigaos) cat=/bin/cat ;; # must be absolute |
1176
|
|
|
|
|
|
|
+esac |
1177
|
|
|
|
|
|
|
+ |
1178
|
|
|
|
|
|
|
$cat /dev/null >.deptmp |
1179
|
|
|
|
|
|
|
$rm -f *.c.c c/*.c.c |
1180
|
|
|
|
|
|
|
if test -f Makefile; then |
1181
|
|
|
|
|
|
|
@@ -67,7 +83,6 @@ |
1182
|
|
|
|
|
|
|
# to be out of date. I don't know if OS/2 has touch, so do this: |
1183
|
|
|
|
|
|
|
case "$osname" in |
1184
|
|
|
|
|
|
|
os2) ;; |
1185
|
|
|
|
|
|
|
- netbsd) ;; |
1186
|
|
|
|
|
|
|
*) $touch $firstmakefile ;; |
1187
|
|
|
|
|
|
|
esac |
1188
|
|
|
|
|
|
|
fi |
1189
|
|
|
|
|
|
|
@@ -99,25 +114,20 @@ |
1190
|
|
|
|
|
|
|
$echo *.c | $tr ' ' $trnl | $egrep -v '\*' >.clist) |
1191
|
|
|
|
|
|
|
for file in `$cat .clist`; do |
1192
|
|
|
|
|
|
|
# for file in `cat /dev/null`; do |
1193
|
|
|
|
|
|
|
- if [ "$osname" = uwin ]; then |
1194
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g -e s,\\([a-zA-Z]\\):/,/\\1/,g" |
1195
|
|
|
|
|
|
|
- else |
1196
|
|
|
|
|
|
|
- if [ "$osname" = os2 ]; then |
1197
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g" |
1198
|
|
|
|
|
|
|
- else |
1199
|
|
|
|
|
|
|
- if [ "$archname" = cygwin ]; then |
1200
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g" |
1201
|
|
|
|
|
|
|
- else |
1202
|
|
|
|
|
|
|
- uwinfix= |
1203
|
|
|
|
|
|
|
- fi |
1204
|
|
|
|
|
|
|
- fi |
1205
|
|
|
|
|
|
|
- fi |
1206
|
|
|
|
|
|
|
+ case "$osname" in |
1207
|
|
|
|
|
|
|
+ uwin) uwinfix="-e s,\\\\\\\\,/,g -e s,\\([a-zA-Z]\\):/,/\\1/,g" ;; |
1208
|
|
|
|
|
|
|
+ os2) uwinfix="-e s,\\\\\\\\,/,g" ;; |
1209
|
|
|
|
|
|
|
+ cygwin) uwinfix="-e s,\\\\\\\\,/,g" ;; |
1210
|
|
|
|
|
|
|
+ posix-bc) uwinfix="-e s/\\*POSIX(\\(.*\\))/\\1/" ;; |
1211
|
|
|
|
|
|
|
+ vos) uwinfix="-e s/\#/\\\#/" ;; |
1212
|
|
|
|
|
|
|
+ *) uwinfix="" ;; |
1213
|
|
|
|
|
|
|
+ esac |
1214
|
|
|
|
|
|
|
case "$file" in |
1215
|
|
|
|
|
|
|
*.c) filebase=`basename $file .c` ;; |
1216
|
|
|
|
|
|
|
*.y) filebase=`basename $file .y` ;; |
1217
|
|
|
|
|
|
|
esac |
1218
|
|
|
|
|
|
|
case "$file" in |
1219
|
|
|
|
|
|
|
- */*) finc="-I`echo $file | sed 's#/[^/]*$##`" ;; |
1220
|
|
|
|
|
|
|
+ */*) finc="-I`echo $file | sed 's#/[^/]*$##'`" ;; |
1221
|
|
|
|
|
|
|
*) finc= ;; |
1222
|
|
|
|
|
|
|
esac |
1223
|
|
|
|
|
|
|
$echo "Finding dependencies for $filebase$_o." |
1224
|
|
|
|
|
|
|
@@ -130,10 +140,12 @@ |
1225
|
|
|
|
|
|
|
-e 's|\\$||' \ |
1226
|
|
|
|
|
|
|
-e p \ |
1227
|
|
|
|
|
|
|
-e '}' ) >UU/$file.c |
1228
|
|
|
|
|
|
|
+ |
1229
|
|
|
|
|
|
|
+ if [ "$osname" = os390 -a "$file" = perly.c ]; then |
1230
|
|
|
|
|
|
|
+ $echo '#endif' >>UU/$file.c |
1231
|
|
|
|
|
|
|
+ fi |
1232
|
|
|
|
|
|
|
+ |
1233
|
|
|
|
|
|
|
if [ "$osname" = os390 ]; then |
1234
|
|
|
|
|
|
|
- if [ "$file" = perly.c ]; then |
1235
|
|
|
|
|
|
|
- $echo '#endif' >>UU/$file.c |
1236
|
|
|
|
|
|
|
- fi |
1237
|
|
|
|
|
|
|
$cppstdin $finc -I. $cppflags $cppminus
|
1238
|
|
|
|
|
|
|
$sed \ |
1239
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
1240
|
|
|
|
|
|
|
@@ -147,18 +159,24 @@ |
1241
|
|
|
|
|
|
|
-e 's|\.c\.c|.c|' $uwinfix | \ |
1242
|
|
|
|
|
|
|
$uniq | $sort | $uniq >> .deptmp |
1243
|
|
|
|
|
|
|
else |
1244
|
|
|
|
|
|
|
- $cppstdin $finc -I. $cppflags $cppminus
|
1245
|
|
|
|
|
|
|
+ $cppstdin $finc -I. $cppflags $cppminus .cout 2>.cerr |
1246
|
|
|
|
|
|
|
$sed \ |
1247
|
|
|
|
|
|
|
-e '1d' \ |
1248
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
1249
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1250
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1251
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1252
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1253
|
|
|
|
|
|
|
-e '/^#.*"-"/d' \ |
1254
|
|
|
|
|
|
|
+ -e '/^#.*"\/.*\/"/d' \ |
1255
|
|
|
|
|
|
|
+ -e '/: file path prefix .* never used$/d' \ |
1256
|
|
|
|
|
|
|
-e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ |
1257
|
|
|
|
|
|
|
-e 's/^[ ]*#[ ]*line/#/' \ |
1258
|
|
|
|
|
|
|
-e '/^# *[0-9][0-9]* *[".\/]/!d' \ |
1259
|
|
|
|
|
|
|
-e 's/^.*"\(.*\)".*$/'$filebase'\$(OBJ_EXT): \1/' \ |
1260
|
|
|
|
|
|
|
-e 's/^# *[0-9][0-9]* \(.*\)$/'$filebase'\$(OBJ_EXT): \1/' \ |
1261
|
|
|
|
|
|
|
-e 's|: \./|: |' \ |
1262
|
|
|
|
|
|
|
- -e 's|\.c\.c|.c|' $uwinfix | \ |
1263
|
|
|
|
|
|
|
+ -e 's|\.c\.c|.c|' $uwinfix .cout .cerr| \ |
1264
|
|
|
|
|
|
|
$uniq | $sort | $uniq >> .deptmp |
1265
|
|
|
|
|
|
|
fi |
1266
|
|
|
|
|
|
|
done |
1267
|
|
|
|
|
|
|
@@ -192,6 +210,10 @@ |
1268
|
|
|
|
|
|
|
$echo "Updating $mf..." |
1269
|
|
|
|
|
|
|
$echo "# If this runs make out of memory, delete /usr/include lines." \ |
1270
|
|
|
|
|
|
|
>> $mf.new |
1271
|
|
|
|
|
|
|
+ if [ "$osname" = vos ]; then |
1272
|
|
|
|
|
|
|
+ $sed 's|.incl.c|.h|' .deptmp >.deptmp.vos |
1273
|
|
|
|
|
|
|
+ mv -f .deptmp.vos .deptmp |
1274
|
|
|
|
|
|
|
+ fi |
1275
|
|
|
|
|
|
|
$sed 's|^\(.*\$(OBJ_EXT):\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" .deptmp \ |
1276
|
|
|
|
|
|
|
>>$mf.new |
1277
|
|
|
|
|
|
|
else |
1278
|
|
|
|
|
|
|
@@ -223,7 +245,8 @@ |
1279
|
|
|
|
|
|
|
$cp $mf.new $mf |
1280
|
|
|
|
|
|
|
$rm $mf.new |
1281
|
|
|
|
|
|
|
$echo "# WARNING: Put nothing here or make depend will gobble it up!" >> $mf |
1282
|
|
|
|
|
|
|
-$rm -rf .deptmp UU .shlist .clist .hlist .hsed |
1283
|
|
|
|
|
|
|
+$rm -rf .deptmp UU .shlist .clist .hlist .hsed .cout .cerr |
1284
|
|
|
|
|
|
|
+rmdir .depending |
1285
|
|
|
|
|
|
|
|
1286
|
|
|
|
|
|
|
!NO!SUBS! |
1287
|
|
|
|
|
|
|
$eunicefix makedepend |
1288
|
|
|
|
|
|
|
BADGER |
1289
|
0
|
|
|
|
|
|
last SWITCH; |
1290
|
|
|
|
|
|
|
} |
1291
|
|
|
|
|
|
|
# If 5.7.1 |
1292
|
0
|
0
|
|
|
|
|
if ( $perl eq '5.7.1' ) { |
1293
|
0
|
|
|
|
|
|
_patch(<<'BADGER'); |
1294
|
|
|
|
|
|
|
--- makedepend.SH.org 2001-03-11 16:30:08.000000000 +0000 |
1295
|
|
|
|
|
|
|
+++ makedepend.SH 2010-09-01 10:44:54.000000000 +0100 |
1296
|
|
|
|
|
|
|
@@ -1,5 +1,5 @@ |
1297
|
|
|
|
|
|
|
#! /bin/sh |
1298
|
|
|
|
|
|
|
-case $CONFIGDOTSH in |
1299
|
|
|
|
|
|
|
+case $PERL_CONFIG_SH in |
1300
|
|
|
|
|
|
|
'') |
1301
|
|
|
|
|
|
|
if test -f config.sh; then TOP=.; |
1302
|
|
|
|
|
|
|
elif test -f ../config.sh; then TOP=..; |
1303
|
|
|
|
|
|
|
@@ -29,6 +29,13 @@ |
1304
|
|
|
|
|
|
|
!GROK!THIS! |
1305
|
|
|
|
|
|
|
$spitshell >>makedepend <<'!NO!SUBS!' |
1306
|
|
|
|
|
|
|
|
1307
|
|
|
|
|
|
|
+if test -d .depending; then |
1308
|
|
|
|
|
|
|
+ echo "$0: Already running, exiting." |
1309
|
|
|
|
|
|
|
+ exit 0 |
1310
|
|
|
|
|
|
|
+fi |
1311
|
|
|
|
|
|
|
+ |
1312
|
|
|
|
|
|
|
+mkdir .depending |
1313
|
|
|
|
|
|
|
+ |
1314
|
|
|
|
|
|
|
# This script should be called with |
1315
|
|
|
|
|
|
|
# sh ./makedepend MAKE=$(MAKE) |
1316
|
|
|
|
|
|
|
case "$1" in |
1317
|
|
|
|
|
|
|
@@ -37,7 +44,7 @@ |
1318
|
|
|
|
|
|
|
|
1319
|
|
|
|
|
|
|
export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh \$0; kill \$\$) |
1320
|
|
|
|
|
|
|
|
1321
|
|
|
|
|
|
|
-case $CONFIGDOTSH in |
1322
|
|
|
|
|
|
|
+case $PERL_CONFIG_SH in |
1323
|
|
|
|
|
|
|
'') |
1324
|
|
|
|
|
|
|
if test -f config.sh; then TOP=.; |
1325
|
|
|
|
|
|
|
elif test -f ../config.sh; then TOP=..; |
1326
|
|
|
|
|
|
|
@@ -51,6 +58,11 @@ |
1327
|
|
|
|
|
|
|
;; |
1328
|
|
|
|
|
|
|
esac |
1329
|
|
|
|
|
|
|
|
1330
|
|
|
|
|
|
|
+# Avoid localized gcc messages |
1331
|
|
|
|
|
|
|
+case "$ccname" in |
1332
|
|
|
|
|
|
|
+ gcc) LC_ALL=C ; export LC_ALL ;; |
1333
|
|
|
|
|
|
|
+esac |
1334
|
|
|
|
|
|
|
+ |
1335
|
|
|
|
|
|
|
# We need .. when we are in the x2p directory if we are using the |
1336
|
|
|
|
|
|
|
# cppstdin wrapper script. |
1337
|
|
|
|
|
|
|
# Put .. and . first so that we pick up the present cppstdin, not |
1338
|
|
|
|
|
|
|
@@ -58,6 +70,10 @@ |
1339
|
|
|
|
|
|
|
PATH=".$path_sep..$path_sep$PATH" |
1340
|
|
|
|
|
|
|
export PATH |
1341
|
|
|
|
|
|
|
|
1342
|
|
|
|
|
|
|
+case "$osname" in |
1343
|
|
|
|
|
|
|
+amigaos) cat=/bin/cat ;; # must be absolute |
1344
|
|
|
|
|
|
|
+esac |
1345
|
|
|
|
|
|
|
+ |
1346
|
|
|
|
|
|
|
$cat /dev/null >.deptmp |
1347
|
|
|
|
|
|
|
$rm -f *.c.c c/*.c.c |
1348
|
|
|
|
|
|
|
if test -f Makefile; then |
1349
|
|
|
|
|
|
|
@@ -67,7 +83,6 @@ |
1350
|
|
|
|
|
|
|
# to be out of date. I don't know if OS/2 has touch, so do this: |
1351
|
|
|
|
|
|
|
case "$osname" in |
1352
|
|
|
|
|
|
|
os2) ;; |
1353
|
|
|
|
|
|
|
- netbsd) ;; |
1354
|
|
|
|
|
|
|
*) $touch $firstmakefile ;; |
1355
|
|
|
|
|
|
|
esac |
1356
|
|
|
|
|
|
|
fi |
1357
|
|
|
|
|
|
|
@@ -99,29 +114,20 @@ |
1358
|
|
|
|
|
|
|
$echo *.c | $tr ' ' $trnl | $egrep -v '\*' >.clist) |
1359
|
|
|
|
|
|
|
for file in `$cat .clist`; do |
1360
|
|
|
|
|
|
|
# for file in `cat /dev/null`; do |
1361
|
|
|
|
|
|
|
- if [ "$osname" = uwin ]; then |
1362
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g -e s,\\([a-zA-Z]\\):/,/\\1/,g" |
1363
|
|
|
|
|
|
|
- else |
1364
|
|
|
|
|
|
|
- if [ "$osname" = os2 ]; then |
1365
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g" |
1366
|
|
|
|
|
|
|
- else |
1367
|
|
|
|
|
|
|
- if [ "$archname" = cygwin ]; then |
1368
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g" |
1369
|
|
|
|
|
|
|
- else |
1370
|
|
|
|
|
|
|
- if [ "$osname" = posix-bc ]; then |
1371
|
|
|
|
|
|
|
- uwinfix="-e s/\\*POSIX(\\(.*\\))/\\1/" |
1372
|
|
|
|
|
|
|
- else |
1373
|
|
|
|
|
|
|
- uwinfix= |
1374
|
|
|
|
|
|
|
- fi |
1375
|
|
|
|
|
|
|
- fi |
1376
|
|
|
|
|
|
|
- fi |
1377
|
|
|
|
|
|
|
- fi |
1378
|
|
|
|
|
|
|
+ case "$osname" in |
1379
|
|
|
|
|
|
|
+ uwin) uwinfix="-e s,\\\\\\\\,/,g -e s,\\([a-zA-Z]\\):/,/\\1/,g" ;; |
1380
|
|
|
|
|
|
|
+ os2) uwinfix="-e s,\\\\\\\\,/,g" ;; |
1381
|
|
|
|
|
|
|
+ cygwin) uwinfix="-e s,\\\\\\\\,/,g" ;; |
1382
|
|
|
|
|
|
|
+ posix-bc) uwinfix="-e s/\\*POSIX(\\(.*\\))/\\1/" ;; |
1383
|
|
|
|
|
|
|
+ vos) uwinfix="-e s/\#/\\\#/" ;; |
1384
|
|
|
|
|
|
|
+ *) uwinfix="" ;; |
1385
|
|
|
|
|
|
|
+ esac |
1386
|
|
|
|
|
|
|
case "$file" in |
1387
|
|
|
|
|
|
|
*.c) filebase=`basename $file .c` ;; |
1388
|
|
|
|
|
|
|
*.y) filebase=`basename $file .y` ;; |
1389
|
|
|
|
|
|
|
esac |
1390
|
|
|
|
|
|
|
case "$file" in |
1391
|
|
|
|
|
|
|
- */*) finc="-I`echo $file | sed 's#/[^/]*$##`" ;; |
1392
|
|
|
|
|
|
|
+ */*) finc="-I`echo $file | sed 's#/[^/]*$##'`" ;; |
1393
|
|
|
|
|
|
|
*) finc= ;; |
1394
|
|
|
|
|
|
|
esac |
1395
|
|
|
|
|
|
|
$echo "Finding dependencies for $filebase$_o." |
1396
|
|
|
|
|
|
|
@@ -134,10 +140,12 @@ |
1397
|
|
|
|
|
|
|
-e 's|\\$||' \ |
1398
|
|
|
|
|
|
|
-e p \ |
1399
|
|
|
|
|
|
|
-e '}' ) >UU/$file.c |
1400
|
|
|
|
|
|
|
+ |
1401
|
|
|
|
|
|
|
+ if [ "$osname" = os390 -a "$file" = perly.c ]; then |
1402
|
|
|
|
|
|
|
+ $echo '#endif' >>UU/$file.c |
1403
|
|
|
|
|
|
|
+ fi |
1404
|
|
|
|
|
|
|
+ |
1405
|
|
|
|
|
|
|
if [ "$osname" = os390 ]; then |
1406
|
|
|
|
|
|
|
- if [ "$file" = perly.c ]; then |
1407
|
|
|
|
|
|
|
- $echo '#endif' >>UU/$file.c |
1408
|
|
|
|
|
|
|
- fi |
1409
|
|
|
|
|
|
|
$cppstdin $finc -I. $cppflags $cppminus
|
1410
|
|
|
|
|
|
|
$sed \ |
1411
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
1412
|
|
|
|
|
|
|
@@ -151,18 +159,24 @@ |
1413
|
|
|
|
|
|
|
-e 's|\.c\.c|.c|' $uwinfix | \ |
1414
|
|
|
|
|
|
|
$uniq | $sort | $uniq >> .deptmp |
1415
|
|
|
|
|
|
|
else |
1416
|
|
|
|
|
|
|
- $cppstdin $finc -I. $cppflags $cppminus
|
1417
|
|
|
|
|
|
|
+ $cppstdin $finc -I. $cppflags $cppminus .cout 2>.cerr |
1418
|
|
|
|
|
|
|
$sed \ |
1419
|
|
|
|
|
|
|
-e '1d' \ |
1420
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
1421
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1422
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1423
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1424
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1425
|
|
|
|
|
|
|
-e '/^#.*"-"/d' \ |
1426
|
|
|
|
|
|
|
+ -e '/^#.*"\/.*\/"/d' \ |
1427
|
|
|
|
|
|
|
+ -e '/: file path prefix .* never used$/d' \ |
1428
|
|
|
|
|
|
|
-e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ |
1429
|
|
|
|
|
|
|
-e 's/^[ ]*#[ ]*line/#/' \ |
1430
|
|
|
|
|
|
|
-e '/^# *[0-9][0-9]* *[".\/]/!d' \ |
1431
|
|
|
|
|
|
|
-e 's/^.*"\(.*\)".*$/'$filebase'\$(OBJ_EXT): \1/' \ |
1432
|
|
|
|
|
|
|
-e 's/^# *[0-9][0-9]* \(.*\)$/'$filebase'\$(OBJ_EXT): \1/' \ |
1433
|
|
|
|
|
|
|
-e 's|: \./|: |' \ |
1434
|
|
|
|
|
|
|
- -e 's|\.c\.c|.c|' $uwinfix | \ |
1435
|
|
|
|
|
|
|
+ -e 's|\.c\.c|.c|' $uwinfix .cout .cerr| \ |
1436
|
|
|
|
|
|
|
$uniq | $sort | $uniq >> .deptmp |
1437
|
|
|
|
|
|
|
fi |
1438
|
|
|
|
|
|
|
done |
1439
|
|
|
|
|
|
|
@@ -196,6 +210,10 @@ |
1440
|
|
|
|
|
|
|
$echo "Updating $mf..." |
1441
|
|
|
|
|
|
|
$echo "# If this runs make out of memory, delete /usr/include lines." \ |
1442
|
|
|
|
|
|
|
>> $mf.new |
1443
|
|
|
|
|
|
|
+ if [ "$osname" = vos ]; then |
1444
|
|
|
|
|
|
|
+ $sed 's|.incl.c|.h|' .deptmp >.deptmp.vos |
1445
|
|
|
|
|
|
|
+ mv -f .deptmp.vos .deptmp |
1446
|
|
|
|
|
|
|
+ fi |
1447
|
|
|
|
|
|
|
$sed 's|^\(.*\$(OBJ_EXT):\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" .deptmp \ |
1448
|
|
|
|
|
|
|
>>$mf.new |
1449
|
|
|
|
|
|
|
else |
1450
|
|
|
|
|
|
|
@@ -227,7 +245,8 @@ |
1451
|
|
|
|
|
|
|
$cp $mf.new $mf |
1452
|
|
|
|
|
|
|
$rm $mf.new |
1453
|
|
|
|
|
|
|
$echo "# WARNING: Put nothing here or make depend will gobble it up!" >> $mf |
1454
|
|
|
|
|
|
|
-$rm -rf .deptmp UU .shlist .clist .hlist .hsed |
1455
|
|
|
|
|
|
|
+$rm -rf .deptmp UU .shlist .clist .hlist .hsed .cout .cerr |
1456
|
|
|
|
|
|
|
+rmdir .depending |
1457
|
|
|
|
|
|
|
|
1458
|
|
|
|
|
|
|
!NO!SUBS! |
1459
|
|
|
|
|
|
|
$eunicefix makedepend |
1460
|
|
|
|
|
|
|
BADGER |
1461
|
0
|
|
|
|
|
|
last SWITCH; |
1462
|
|
|
|
|
|
|
} |
1463
|
|
|
|
|
|
|
# If 5.7.2 |
1464
|
0
|
0
|
|
|
|
|
if ( $perl eq '5.7.2' ) { |
1465
|
0
|
|
|
|
|
|
_patch(<<'BADGER'); |
1466
|
|
|
|
|
|
|
--- makedepend.SH.org 2001-07-09 15:11:05.000000000 +0100 |
1467
|
|
|
|
|
|
|
+++ makedepend.SH 2010-09-01 10:45:32.000000000 +0100 |
1468
|
|
|
|
|
|
|
@@ -18,10 +18,6 @@ |
1469
|
|
|
|
|
|
|
*/*) cd `expr X$0 : 'X\(.*\)/'` ;; |
1470
|
|
|
|
|
|
|
esac |
1471
|
|
|
|
|
|
|
|
1472
|
|
|
|
|
|
|
-case "$osname" in |
1473
|
|
|
|
|
|
|
-amigaos) cat=/bin/cat ;; # must be absolute |
1474
|
|
|
|
|
|
|
-esac |
1475
|
|
|
|
|
|
|
- |
1476
|
|
|
|
|
|
|
echo "Extracting makedepend (with variable substitutions)" |
1477
|
|
|
|
|
|
|
rm -f makedepend |
1478
|
|
|
|
|
|
|
$spitshell >makedepend <
|
1479
|
|
|
|
|
|
|
@@ -33,6 +29,13 @@ |
1480
|
|
|
|
|
|
|
!GROK!THIS! |
1481
|
|
|
|
|
|
|
$spitshell >>makedepend <<'!NO!SUBS!' |
1482
|
|
|
|
|
|
|
|
1483
|
|
|
|
|
|
|
+if test -d .depending; then |
1484
|
|
|
|
|
|
|
+ echo "$0: Already running, exiting." |
1485
|
|
|
|
|
|
|
+ exit 0 |
1486
|
|
|
|
|
|
|
+fi |
1487
|
|
|
|
|
|
|
+ |
1488
|
|
|
|
|
|
|
+mkdir .depending |
1489
|
|
|
|
|
|
|
+ |
1490
|
|
|
|
|
|
|
# This script should be called with |
1491
|
|
|
|
|
|
|
# sh ./makedepend MAKE=$(MAKE) |
1492
|
|
|
|
|
|
|
case "$1" in |
1493
|
|
|
|
|
|
|
@@ -55,6 +58,11 @@ |
1494
|
|
|
|
|
|
|
;; |
1495
|
|
|
|
|
|
|
esac |
1496
|
|
|
|
|
|
|
|
1497
|
|
|
|
|
|
|
+# Avoid localized gcc messages |
1498
|
|
|
|
|
|
|
+case "$ccname" in |
1499
|
|
|
|
|
|
|
+ gcc) LC_ALL=C ; export LC_ALL ;; |
1500
|
|
|
|
|
|
|
+esac |
1501
|
|
|
|
|
|
|
+ |
1502
|
|
|
|
|
|
|
# We need .. when we are in the x2p directory if we are using the |
1503
|
|
|
|
|
|
|
# cppstdin wrapper script. |
1504
|
|
|
|
|
|
|
# Put .. and . first so that we pick up the present cppstdin, not |
1505
|
|
|
|
|
|
|
@@ -62,6 +70,10 @@ |
1506
|
|
|
|
|
|
|
PATH=".$path_sep..$path_sep$PATH" |
1507
|
|
|
|
|
|
|
export PATH |
1508
|
|
|
|
|
|
|
|
1509
|
|
|
|
|
|
|
+case "$osname" in |
1510
|
|
|
|
|
|
|
+amigaos) cat=/bin/cat ;; # must be absolute |
1511
|
|
|
|
|
|
|
+esac |
1512
|
|
|
|
|
|
|
+ |
1513
|
|
|
|
|
|
|
$cat /dev/null >.deptmp |
1514
|
|
|
|
|
|
|
$rm -f *.c.c c/*.c.c |
1515
|
|
|
|
|
|
|
if test -f Makefile; then |
1516
|
|
|
|
|
|
|
@@ -71,7 +83,6 @@ |
1517
|
|
|
|
|
|
|
# to be out of date. I don't know if OS/2 has touch, so do this: |
1518
|
|
|
|
|
|
|
case "$osname" in |
1519
|
|
|
|
|
|
|
os2) ;; |
1520
|
|
|
|
|
|
|
- netbsd) ;; |
1521
|
|
|
|
|
|
|
*) $touch $firstmakefile ;; |
1522
|
|
|
|
|
|
|
esac |
1523
|
|
|
|
|
|
|
fi |
1524
|
|
|
|
|
|
|
@@ -103,29 +114,20 @@ |
1525
|
|
|
|
|
|
|
$echo *.c | $tr ' ' $trnl | $egrep -v '\*' >.clist) |
1526
|
|
|
|
|
|
|
for file in `$cat .clist`; do |
1527
|
|
|
|
|
|
|
# for file in `cat /dev/null`; do |
1528
|
|
|
|
|
|
|
- if [ "$osname" = uwin ]; then |
1529
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g -e s,\\([a-zA-Z]\\):/,/\\1/,g" |
1530
|
|
|
|
|
|
|
- else |
1531
|
|
|
|
|
|
|
- if [ "$osname" = os2 ]; then |
1532
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g" |
1533
|
|
|
|
|
|
|
- else |
1534
|
|
|
|
|
|
|
- if [ "$archname" = cygwin ]; then |
1535
|
|
|
|
|
|
|
- uwinfix="-e s,\\\\\\\\,/,g" |
1536
|
|
|
|
|
|
|
- else |
1537
|
|
|
|
|
|
|
- if [ "$osname" = posix-bc ]; then |
1538
|
|
|
|
|
|
|
- uwinfix="-e s/\\*POSIX(\\(.*\\))/\\1/" |
1539
|
|
|
|
|
|
|
- else |
1540
|
|
|
|
|
|
|
- uwinfix= |
1541
|
|
|
|
|
|
|
- fi |
1542
|
|
|
|
|
|
|
- fi |
1543
|
|
|
|
|
|
|
- fi |
1544
|
|
|
|
|
|
|
- fi |
1545
|
|
|
|
|
|
|
+ case "$osname" in |
1546
|
|
|
|
|
|
|
+ uwin) uwinfix="-e s,\\\\\\\\,/,g -e s,\\([a-zA-Z]\\):/,/\\1/,g" ;; |
1547
|
|
|
|
|
|
|
+ os2) uwinfix="-e s,\\\\\\\\,/,g" ;; |
1548
|
|
|
|
|
|
|
+ cygwin) uwinfix="-e s,\\\\\\\\,/,g" ;; |
1549
|
|
|
|
|
|
|
+ posix-bc) uwinfix="-e s/\\*POSIX(\\(.*\\))/\\1/" ;; |
1550
|
|
|
|
|
|
|
+ vos) uwinfix="-e s/\#/\\\#/" ;; |
1551
|
|
|
|
|
|
|
+ *) uwinfix="" ;; |
1552
|
|
|
|
|
|
|
+ esac |
1553
|
|
|
|
|
|
|
case "$file" in |
1554
|
|
|
|
|
|
|
*.c) filebase=`basename $file .c` ;; |
1555
|
|
|
|
|
|
|
*.y) filebase=`basename $file .y` ;; |
1556
|
|
|
|
|
|
|
esac |
1557
|
|
|
|
|
|
|
case "$file" in |
1558
|
|
|
|
|
|
|
- */*) finc="-I`echo $file | sed 's#/[^/]*$##`" ;; |
1559
|
|
|
|
|
|
|
+ */*) finc="-I`echo $file | sed 's#/[^/]*$##'`" ;; |
1560
|
|
|
|
|
|
|
*) finc= ;; |
1561
|
|
|
|
|
|
|
esac |
1562
|
|
|
|
|
|
|
$echo "Finding dependencies for $filebase$_o." |
1563
|
|
|
|
|
|
|
@@ -138,10 +140,12 @@ |
1564
|
|
|
|
|
|
|
-e 's|\\$||' \ |
1565
|
|
|
|
|
|
|
-e p \ |
1566
|
|
|
|
|
|
|
-e '}' ) >UU/$file.c |
1567
|
|
|
|
|
|
|
+ |
1568
|
|
|
|
|
|
|
+ if [ "$osname" = os390 -a "$file" = perly.c ]; then |
1569
|
|
|
|
|
|
|
+ $echo '#endif' >>UU/$file.c |
1570
|
|
|
|
|
|
|
+ fi |
1571
|
|
|
|
|
|
|
+ |
1572
|
|
|
|
|
|
|
if [ "$osname" = os390 ]; then |
1573
|
|
|
|
|
|
|
- if [ "$file" = perly.c ]; then |
1574
|
|
|
|
|
|
|
- $echo '#endif' >>UU/$file.c |
1575
|
|
|
|
|
|
|
- fi |
1576
|
|
|
|
|
|
|
$cppstdin $finc -I. $cppflags $cppminus
|
1577
|
|
|
|
|
|
|
$sed \ |
1578
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
1579
|
|
|
|
|
|
|
@@ -155,18 +159,24 @@ |
1580
|
|
|
|
|
|
|
-e 's|\.c\.c|.c|' $uwinfix | \ |
1581
|
|
|
|
|
|
|
$uniq | $sort | $uniq >> .deptmp |
1582
|
|
|
|
|
|
|
else |
1583
|
|
|
|
|
|
|
- $cppstdin $finc -I. $cppflags $cppminus
|
1584
|
|
|
|
|
|
|
+ $cppstdin $finc -I. $cppflags $cppminus .cout 2>.cerr |
1585
|
|
|
|
|
|
|
$sed \ |
1586
|
|
|
|
|
|
|
-e '1d' \ |
1587
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
1588
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1589
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1590
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1591
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1592
|
|
|
|
|
|
|
-e '/^#.*"-"/d' \ |
1593
|
|
|
|
|
|
|
+ -e '/^#.*"\/.*\/"/d' \ |
1594
|
|
|
|
|
|
|
+ -e '/: file path prefix .* never used$/d' \ |
1595
|
|
|
|
|
|
|
-e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ |
1596
|
|
|
|
|
|
|
-e 's/^[ ]*#[ ]*line/#/' \ |
1597
|
|
|
|
|
|
|
-e '/^# *[0-9][0-9]* *[".\/]/!d' \ |
1598
|
|
|
|
|
|
|
-e 's/^.*"\(.*\)".*$/'$filebase'\$(OBJ_EXT): \1/' \ |
1599
|
|
|
|
|
|
|
-e 's/^# *[0-9][0-9]* \(.*\)$/'$filebase'\$(OBJ_EXT): \1/' \ |
1600
|
|
|
|
|
|
|
-e 's|: \./|: |' \ |
1601
|
|
|
|
|
|
|
- -e 's|\.c\.c|.c|' $uwinfix | \ |
1602
|
|
|
|
|
|
|
+ -e 's|\.c\.c|.c|' $uwinfix .cout .cerr| \ |
1603
|
|
|
|
|
|
|
$uniq | $sort | $uniq >> .deptmp |
1604
|
|
|
|
|
|
|
fi |
1605
|
|
|
|
|
|
|
done |
1606
|
|
|
|
|
|
|
@@ -200,6 +210,10 @@ |
1607
|
|
|
|
|
|
|
$echo "Updating $mf..." |
1608
|
|
|
|
|
|
|
$echo "# If this runs make out of memory, delete /usr/include lines." \ |
1609
|
|
|
|
|
|
|
>> $mf.new |
1610
|
|
|
|
|
|
|
+ if [ "$osname" = vos ]; then |
1611
|
|
|
|
|
|
|
+ $sed 's|.incl.c|.h|' .deptmp >.deptmp.vos |
1612
|
|
|
|
|
|
|
+ mv -f .deptmp.vos .deptmp |
1613
|
|
|
|
|
|
|
+ fi |
1614
|
|
|
|
|
|
|
$sed 's|^\(.*\$(OBJ_EXT):\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" .deptmp \ |
1615
|
|
|
|
|
|
|
>>$mf.new |
1616
|
|
|
|
|
|
|
else |
1617
|
|
|
|
|
|
|
@@ -231,7 +245,8 @@ |
1618
|
|
|
|
|
|
|
$cp $mf.new $mf |
1619
|
|
|
|
|
|
|
$rm $mf.new |
1620
|
|
|
|
|
|
|
$echo "# WARNING: Put nothing here or make depend will gobble it up!" >> $mf |
1621
|
|
|
|
|
|
|
-$rm -rf .deptmp UU .shlist .clist .hlist .hsed |
1622
|
|
|
|
|
|
|
+$rm -rf .deptmp UU .shlist .clist .hlist .hsed .cout .cerr |
1623
|
|
|
|
|
|
|
+rmdir .depending |
1624
|
|
|
|
|
|
|
|
1625
|
|
|
|
|
|
|
!NO!SUBS! |
1626
|
|
|
|
|
|
|
$eunicefix makedepend |
1627
|
|
|
|
|
|
|
BADGER |
1628
|
0
|
|
|
|
|
|
last SWITCH; |
1629
|
|
|
|
|
|
|
} |
1630
|
|
|
|
|
|
|
# If 5.7.3 |
1631
|
0
|
0
|
|
|
|
|
if ( $perl eq '5.7.3' ) { |
1632
|
0
|
|
|
|
|
|
_patch(<<'BADGER'); |
1633
|
|
|
|
|
|
|
--- makedepend.SH.org 2002-03-05 01:10:22.000000000 +0000 |
1634
|
|
|
|
|
|
|
+++ makedepend.SH 2010-09-01 10:46:13.000000000 +0100 |
1635
|
|
|
|
|
|
|
@@ -18,10 +18,6 @@ |
1636
|
|
|
|
|
|
|
*/*) cd `expr X$0 : 'X\(.*\)/'` ;; |
1637
|
|
|
|
|
|
|
esac |
1638
|
|
|
|
|
|
|
|
1639
|
|
|
|
|
|
|
-case "$osname" in |
1640
|
|
|
|
|
|
|
-amigaos) cat=/bin/cat ;; # must be absolute |
1641
|
|
|
|
|
|
|
-esac |
1642
|
|
|
|
|
|
|
- |
1643
|
|
|
|
|
|
|
echo "Extracting makedepend (with variable substitutions)" |
1644
|
|
|
|
|
|
|
rm -f makedepend |
1645
|
|
|
|
|
|
|
$spitshell >makedepend <
|
1646
|
|
|
|
|
|
|
@@ -33,6 +29,13 @@ |
1647
|
|
|
|
|
|
|
!GROK!THIS! |
1648
|
|
|
|
|
|
|
$spitshell >>makedepend <<'!NO!SUBS!' |
1649
|
|
|
|
|
|
|
|
1650
|
|
|
|
|
|
|
+if test -d .depending; then |
1651
|
|
|
|
|
|
|
+ echo "$0: Already running, exiting." |
1652
|
|
|
|
|
|
|
+ exit 0 |
1653
|
|
|
|
|
|
|
+fi |
1654
|
|
|
|
|
|
|
+ |
1655
|
|
|
|
|
|
|
+mkdir .depending |
1656
|
|
|
|
|
|
|
+ |
1657
|
|
|
|
|
|
|
# This script should be called with |
1658
|
|
|
|
|
|
|
# sh ./makedepend MAKE=$(MAKE) |
1659
|
|
|
|
|
|
|
case "$1" in |
1660
|
|
|
|
|
|
|
@@ -55,6 +58,11 @@ |
1661
|
|
|
|
|
|
|
;; |
1662
|
|
|
|
|
|
|
esac |
1663
|
|
|
|
|
|
|
|
1664
|
|
|
|
|
|
|
+# Avoid localized gcc messages |
1665
|
|
|
|
|
|
|
+case "$ccname" in |
1666
|
|
|
|
|
|
|
+ gcc) LC_ALL=C ; export LC_ALL ;; |
1667
|
|
|
|
|
|
|
+esac |
1668
|
|
|
|
|
|
|
+ |
1669
|
|
|
|
|
|
|
# We need .. when we are in the x2p directory if we are using the |
1670
|
|
|
|
|
|
|
# cppstdin wrapper script. |
1671
|
|
|
|
|
|
|
# Put .. and . first so that we pick up the present cppstdin, not |
1672
|
|
|
|
|
|
|
@@ -62,6 +70,10 @@ |
1673
|
|
|
|
|
|
|
PATH=".$path_sep..$path_sep$PATH" |
1674
|
|
|
|
|
|
|
export PATH |
1675
|
|
|
|
|
|
|
|
1676
|
|
|
|
|
|
|
+case "$osname" in |
1677
|
|
|
|
|
|
|
+amigaos) cat=/bin/cat ;; # must be absolute |
1678
|
|
|
|
|
|
|
+esac |
1679
|
|
|
|
|
|
|
+ |
1680
|
|
|
|
|
|
|
$cat /dev/null >.deptmp |
1681
|
|
|
|
|
|
|
$rm -f *.c.c c/*.c.c |
1682
|
|
|
|
|
|
|
if test -f Makefile; then |
1683
|
|
|
|
|
|
|
@@ -71,7 +83,6 @@ |
1684
|
|
|
|
|
|
|
# to be out of date. I don't know if OS/2 has touch, so do this: |
1685
|
|
|
|
|
|
|
case "$osname" in |
1686
|
|
|
|
|
|
|
os2) ;; |
1687
|
|
|
|
|
|
|
- netbsd) ;; |
1688
|
|
|
|
|
|
|
*) $touch $firstmakefile ;; |
1689
|
|
|
|
|
|
|
esac |
1690
|
|
|
|
|
|
|
fi |
1691
|
|
|
|
|
|
|
@@ -116,7 +127,7 @@ |
1692
|
|
|
|
|
|
|
*.y) filebase=`basename $file .y` ;; |
1693
|
|
|
|
|
|
|
esac |
1694
|
|
|
|
|
|
|
case "$file" in |
1695
|
|
|
|
|
|
|
- */*) finc="-I`echo $file | sed 's#/[^/]*$##`" ;; |
1696
|
|
|
|
|
|
|
+ */*) finc="-I`echo $file | sed 's#/[^/]*$##'`" ;; |
1697
|
|
|
|
|
|
|
*) finc= ;; |
1698
|
|
|
|
|
|
|
esac |
1699
|
|
|
|
|
|
|
$echo "Finding dependencies for $filebase$_o." |
1700
|
|
|
|
|
|
|
@@ -129,6 +140,11 @@ |
1701
|
|
|
|
|
|
|
-e 's|\\$||' \ |
1702
|
|
|
|
|
|
|
-e p \ |
1703
|
|
|
|
|
|
|
-e '}' ) >UU/$file.c |
1704
|
|
|
|
|
|
|
+ |
1705
|
|
|
|
|
|
|
+ if [ "$osname" = os390 -a "$file" = perly.c ]; then |
1706
|
|
|
|
|
|
|
+ $echo '#endif' >>UU/$file.c |
1707
|
|
|
|
|
|
|
+ fi |
1708
|
|
|
|
|
|
|
+ |
1709
|
|
|
|
|
|
|
if [ "$osname" = os390 ]; then |
1710
|
|
|
|
|
|
|
$cppstdin $finc -I. $cppflags $cppminus
|
1711
|
|
|
|
|
|
|
$sed \ |
1712
|
|
|
|
|
|
|
@@ -143,13 +159,16 @@ |
1713
|
|
|
|
|
|
|
-e 's|\.c\.c|.c|' $uwinfix | \ |
1714
|
|
|
|
|
|
|
$uniq | $sort | $uniq >> .deptmp |
1715
|
|
|
|
|
|
|
else |
1716
|
|
|
|
|
|
|
- $cppstdin $finc -I. $cppflags $cppminus &1 | |
1717
|
|
|
|
|
|
|
+ $cppstdin $finc -I. $cppflags $cppminus .cout 2>.cerr |
1718
|
|
|
|
|
|
|
$sed \ |
1719
|
|
|
|
|
|
|
-e '1d' \ |
1720
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
1721
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
1722
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1723
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
1724
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1725
|
|
|
|
|
|
|
-e '/^#.*"-"/d' \ |
1726
|
|
|
|
|
|
|
+ -e '/^#.*"\/.*\/"/d' \ |
1727
|
|
|
|
|
|
|
-e '/: file path prefix .* never used$/d' \ |
1728
|
|
|
|
|
|
|
-e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ |
1729
|
|
|
|
|
|
|
-e 's/^[ ]*#[ ]*line/#/' \ |
1730
|
|
|
|
|
|
|
@@ -157,7 +176,7 @@ |
1731
|
|
|
|
|
|
|
-e 's/^.*"\(.*\)".*$/'$filebase'\$(OBJ_EXT): \1/' \ |
1732
|
|
|
|
|
|
|
-e 's/^# *[0-9][0-9]* \(.*\)$/'$filebase'\$(OBJ_EXT): \1/' \ |
1733
|
|
|
|
|
|
|
-e 's|: \./|: |' \ |
1734
|
|
|
|
|
|
|
- -e 's|\.c\.c|.c|' $uwinfix | \ |
1735
|
|
|
|
|
|
|
+ -e 's|\.c\.c|.c|' $uwinfix .cout .cerr| \ |
1736
|
|
|
|
|
|
|
$uniq | $sort | $uniq >> .deptmp |
1737
|
|
|
|
|
|
|
fi |
1738
|
|
|
|
|
|
|
done |
1739
|
|
|
|
|
|
|
@@ -191,6 +210,10 @@ |
1740
|
|
|
|
|
|
|
$echo "Updating $mf..." |
1741
|
|
|
|
|
|
|
$echo "# If this runs make out of memory, delete /usr/include lines." \ |
1742
|
|
|
|
|
|
|
>> $mf.new |
1743
|
|
|
|
|
|
|
+ if [ "$osname" = vos ]; then |
1744
|
|
|
|
|
|
|
+ $sed 's|.incl.c|.h|' .deptmp >.deptmp.vos |
1745
|
|
|
|
|
|
|
+ mv -f .deptmp.vos .deptmp |
1746
|
|
|
|
|
|
|
+ fi |
1747
|
|
|
|
|
|
|
$sed 's|^\(.*\$(OBJ_EXT):\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" .deptmp \ |
1748
|
|
|
|
|
|
|
>>$mf.new |
1749
|
|
|
|
|
|
|
else |
1750
|
|
|
|
|
|
|
@@ -222,7 +245,8 @@ |
1751
|
|
|
|
|
|
|
$cp $mf.new $mf |
1752
|
|
|
|
|
|
|
$rm $mf.new |
1753
|
|
|
|
|
|
|
$echo "# WARNING: Put nothing here or make depend will gobble it up!" >> $mf |
1754
|
|
|
|
|
|
|
-$rm -rf .deptmp UU .shlist .clist .hlist .hsed |
1755
|
|
|
|
|
|
|
+$rm -rf .deptmp UU .shlist .clist .hlist .hsed .cout .cerr |
1756
|
|
|
|
|
|
|
+rmdir .depending |
1757
|
|
|
|
|
|
|
|
1758
|
|
|
|
|
|
|
!NO!SUBS! |
1759
|
|
|
|
|
|
|
$eunicefix makedepend |
1760
|
|
|
|
|
|
|
BADGER |
1761
|
0
|
|
|
|
|
|
last SWITCH; |
1762
|
|
|
|
|
|
|
} |
1763
|
|
|
|
|
|
|
# If 5.8.0 |
1764
|
0
|
0
|
|
|
|
|
if ( $perl eq '5.8.0' ) { |
1765
|
0
|
|
|
|
|
|
_patch(<<'BADGER'); |
1766
|
|
|
|
|
|
|
--- makedepend.SH.org 2002-07-09 15:06:42.000000000 +0100 |
1767
|
|
|
|
|
|
|
+++ makedepend.SH 2010-09-01 10:16:37.000000000 +0100 |
1768
|
|
|
|
|
|
|
@@ -58,6 +58,11 @@ |
1769
|
|
|
|
|
|
|
;; |
1770
|
|
|
|
|
|
|
esac |
1771
|
|
|
|
|
|
|
|
1772
|
|
|
|
|
|
|
+# Avoid localized gcc messages |
1773
|
|
|
|
|
|
|
+case "$ccname" in |
1774
|
|
|
|
|
|
|
+ gcc) LC_ALL=C ; export LC_ALL ;; |
1775
|
|
|
|
|
|
|
+esac |
1776
|
|
|
|
|
|
|
+ |
1777
|
|
|
|
|
|
|
# We need .. when we are in the x2p directory if we are using the |
1778
|
|
|
|
|
|
|
# cppstdin wrapper script. |
1779
|
|
|
|
|
|
|
# Put .. and . first so that we pick up the present cppstdin, not |
1780
|
|
|
|
|
|
|
@@ -78,7 +83,6 @@ |
1781
|
|
|
|
|
|
|
# to be out of date. I don't know if OS/2 has touch, so do this: |
1782
|
|
|
|
|
|
|
case "$osname" in |
1783
|
|
|
|
|
|
|
os2) ;; |
1784
|
|
|
|
|
|
|
- netbsd) ;; |
1785
|
|
|
|
|
|
|
*) $touch $firstmakefile ;; |
1786
|
|
|
|
|
|
|
esac |
1787
|
|
|
|
|
|
|
fi |
1788
|
|
|
|
|
|
|
@@ -123,7 +127,7 @@ |
1789
|
|
|
|
|
|
|
*.y) filebase=`basename $file .y` ;; |
1790
|
|
|
|
|
|
|
esac |
1791
|
|
|
|
|
|
|
case "$file" in |
1792
|
|
|
|
|
|
|
- */*) finc="-I`echo $file | sed 's#/[^/]*$##`" ;; |
1793
|
|
|
|
|
|
|
+ */*) finc="-I`echo $file | sed 's#/[^/]*$##'`" ;; |
1794
|
|
|
|
|
|
|
*) finc= ;; |
1795
|
|
|
|
|
|
|
esac |
1796
|
|
|
|
|
|
|
$echo "Finding dependencies for $filebase$_o." |
1797
|
|
|
|
|
|
|
@@ -136,6 +140,11 @@ |
1798
|
|
|
|
|
|
|
-e 's|\\$||' \ |
1799
|
|
|
|
|
|
|
-e p \ |
1800
|
|
|
|
|
|
|
-e '}' ) >UU/$file.c |
1801
|
|
|
|
|
|
|
+ |
1802
|
|
|
|
|
|
|
+ if [ "$osname" = os390 -a "$file" = perly.c ]; then |
1803
|
|
|
|
|
|
|
+ $echo '#endif' >>UU/$file.c |
1804
|
|
|
|
|
|
|
+ fi |
1805
|
|
|
|
|
|
|
+ |
1806
|
|
|
|
|
|
|
if [ "$osname" = os390 ]; then |
1807
|
|
|
|
|
|
|
$cppstdin $finc -I. $cppflags $cppminus
|
1808
|
|
|
|
|
|
|
$sed \ |
1809
|
|
|
|
|
|
|
@@ -157,7 +166,9 @@ |
1810
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
1811
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
1812
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
1813
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1814
|
|
|
|
|
|
|
-e '/^#.*"-"/d' \ |
1815
|
|
|
|
|
|
|
+ -e '/^#.*"\/.*\/"/d' \ |
1816
|
|
|
|
|
|
|
-e '/: file path prefix .* never used$/d' \ |
1817
|
|
|
|
|
|
|
-e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ |
1818
|
|
|
|
|
|
|
-e 's/^[ ]*#[ ]*line/#/' \ |
1819
|
|
|
|
|
|
|
@@ -199,6 +210,10 @@ |
1820
|
|
|
|
|
|
|
$echo "Updating $mf..." |
1821
|
|
|
|
|
|
|
$echo "# If this runs make out of memory, delete /usr/include lines." \ |
1822
|
|
|
|
|
|
|
>> $mf.new |
1823
|
|
|
|
|
|
|
+ if [ "$osname" = vos ]; then |
1824
|
|
|
|
|
|
|
+ $sed 's|.incl.c|.h|' .deptmp >.deptmp.vos |
1825
|
|
|
|
|
|
|
+ mv -f .deptmp.vos .deptmp |
1826
|
|
|
|
|
|
|
+ fi |
1827
|
|
|
|
|
|
|
$sed 's|^\(.*\$(OBJ_EXT):\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" .deptmp \ |
1828
|
|
|
|
|
|
|
>>$mf.new |
1829
|
|
|
|
|
|
|
else |
1830
|
|
|
|
|
|
|
BADGER |
1831
|
0
|
|
|
|
|
|
last SWITCH; |
1832
|
|
|
|
|
|
|
} |
1833
|
|
|
|
|
|
|
# If 5.8.[12345678] |
1834
|
0
|
|
|
|
|
|
_patch(<<'BADGER'); |
1835
|
|
|
|
|
|
|
--- makedepend.SH.org 2003-06-05 19:11:10.000000000 +0100 |
1836
|
|
|
|
|
|
|
+++ makedepend.SH 2010-09-01 10:24:39.000000000 +0100 |
1837
|
|
|
|
|
|
|
@@ -83,7 +83,6 @@ |
1838
|
|
|
|
|
|
|
# to be out of date. I don't know if OS/2 has touch, so do this: |
1839
|
|
|
|
|
|
|
case "$osname" in |
1840
|
|
|
|
|
|
|
os2) ;; |
1841
|
|
|
|
|
|
|
- netbsd) ;; |
1842
|
|
|
|
|
|
|
*) $touch $firstmakefile ;; |
1843
|
|
|
|
|
|
|
esac |
1844
|
|
|
|
|
|
|
fi |
1845
|
|
|
|
|
|
|
@@ -128,7 +127,7 @@ |
1846
|
|
|
|
|
|
|
*.y) filebase=`basename $file .y` ;; |
1847
|
|
|
|
|
|
|
esac |
1848
|
|
|
|
|
|
|
case "$file" in |
1849
|
|
|
|
|
|
|
- */*) finc="-I`echo $file | sed 's#/[^/]*$##`" ;; |
1850
|
|
|
|
|
|
|
+ */*) finc="-I`echo $file | sed 's#/[^/]*$##'`" ;; |
1851
|
|
|
|
|
|
|
*) finc= ;; |
1852
|
|
|
|
|
|
|
esac |
1853
|
|
|
|
|
|
|
$echo "Finding dependencies for $filebase$_o." |
1854
|
|
|
|
|
|
|
@@ -167,7 +166,9 @@ |
1855
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
1856
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
1857
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
1858
|
|
|
|
|
|
|
+ -e '/^#.*/d' \ |
1859
|
|
|
|
|
|
|
-e '/^#.*"-"/d' \ |
1860
|
|
|
|
|
|
|
+ -e '/^#.*"\/.*\/"/d' \ |
1861
|
|
|
|
|
|
|
-e '/: file path prefix .* never used$/d' \ |
1862
|
|
|
|
|
|
|
-e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ |
1863
|
|
|
|
|
|
|
-e 's/^[ ]*#[ ]*line/#/' \ |
1864
|
|
|
|
|
|
|
@@ -209,6 +210,10 @@ |
1865
|
|
|
|
|
|
|
$echo "Updating $mf..." |
1866
|
|
|
|
|
|
|
$echo "# If this runs make out of memory, delete /usr/include lines." \ |
1867
|
|
|
|
|
|
|
>> $mf.new |
1868
|
|
|
|
|
|
|
+ if [ "$osname" = vos ]; then |
1869
|
|
|
|
|
|
|
+ $sed 's|.incl.c|.h|' .deptmp >.deptmp.vos |
1870
|
|
|
|
|
|
|
+ mv -f .deptmp.vos .deptmp |
1871
|
|
|
|
|
|
|
+ fi |
1872
|
|
|
|
|
|
|
$sed 's|^\(.*\$(OBJ_EXT):\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" .deptmp \ |
1873
|
|
|
|
|
|
|
>>$mf.new |
1874
|
|
|
|
|
|
|
else |
1875
|
|
|
|
|
|
|
BADGER |
1876
|
|
|
|
|
|
|
} |
1877
|
|
|
|
|
|
|
} |
1878
|
|
|
|
|
|
|
|
1879
|
|
|
|
|
|
|
sub _patch_conf_gconvert |
1880
|
|
|
|
|
|
|
{ |
1881
|
0
|
|
|
0
|
|
|
my $perl = shift; |
1882
|
0
|
|
|
|
|
|
_patch(<<'END'); |
1883
|
|
|
|
|
|
|
--- Configure |
1884
|
|
|
|
|
|
|
+++ Configure |
1885
|
|
|
|
|
|
|
@@ -7851,6 +7851,21 @@ int main() |
1886
|
|
|
|
|
|
|
Gconvert((DOUBLETYPE)0.1, 8, 0, buf); |
1887
|
|
|
|
|
|
|
checkit("0.1", buf); |
1888
|
|
|
|
|
|
|
|
1889
|
|
|
|
|
|
|
+ Gconvert((DOUBLETYPE)0.01, 8, 0, buf); |
1890
|
|
|
|
|
|
|
+ checkit("0.01", buf); |
1891
|
|
|
|
|
|
|
+ |
1892
|
|
|
|
|
|
|
+ Gconvert((DOUBLETYPE)0.001, 8, 0, buf); |
1893
|
|
|
|
|
|
|
+ checkit("0.001", buf); |
1894
|
|
|
|
|
|
|
+ |
1895
|
|
|
|
|
|
|
+ Gconvert((DOUBLETYPE)0.0001, 8, 0, buf); |
1896
|
|
|
|
|
|
|
+ checkit("0.0001", buf); |
1897
|
|
|
|
|
|
|
+ |
1898
|
|
|
|
|
|
|
+ Gconvert((DOUBLETYPE)0.00009, 8, 0, buf); |
1899
|
|
|
|
|
|
|
+ if (strlen(buf) > 5) |
1900
|
|
|
|
|
|
|
+ checkit("9e-005", buf); /* for Microsoft ?? */ |
1901
|
|
|
|
|
|
|
+ else |
1902
|
|
|
|
|
|
|
+ checkit("9e-05", buf); |
1903
|
|
|
|
|
|
|
+ |
1904
|
|
|
|
|
|
|
Gconvert((DOUBLETYPE)1.0, 8, 0, buf); |
1905
|
|
|
|
|
|
|
checkit("1", buf); |
1906
|
|
|
|
|
|
|
|
1907
|
|
|
|
|
|
|
@@ -7889,6 +7904,19 @@ int main() |
1908
|
|
|
|
|
|
|
Gconvert((DOUBLETYPE)123.456, 8, 0, buf); |
1909
|
|
|
|
|
|
|
checkit("123.456", buf); |
1910
|
|
|
|
|
|
|
|
1911
|
|
|
|
|
|
|
+ /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */ |
1912
|
|
|
|
|
|
|
+ Gconvert((DOUBLETYPE)1e34, 8, 0, buf); |
1913
|
|
|
|
|
|
|
+ /* 34 should be enough to scare even long double |
1914
|
|
|
|
|
|
|
+ * places into using the e notation. */ |
1915
|
|
|
|
|
|
|
+ if (strlen(buf) > 5) |
1916
|
|
|
|
|
|
|
+ checkit("1e+034", buf); /* for Microsoft */ |
1917
|
|
|
|
|
|
|
+ else |
1918
|
|
|
|
|
|
|
+ checkit("1e+34", buf); |
1919
|
|
|
|
|
|
|
+ |
1920
|
|
|
|
|
|
|
+ /* For Perl, if you add additional tests here, also add them to |
1921
|
|
|
|
|
|
|
+ * t/base/num.t for benefit of platforms not using Configure or |
1922
|
|
|
|
|
|
|
+ * overriding d_Gconvert */ |
1923
|
|
|
|
|
|
|
+ |
1924
|
|
|
|
|
|
|
exit(0); |
1925
|
|
|
|
|
|
|
} |
1926
|
|
|
|
|
|
|
EOP |
1927
|
|
|
|
|
|
|
END |
1928
|
|
|
|
|
|
|
} |
1929
|
|
|
|
|
|
|
|
1930
|
|
|
|
|
|
|
sub _patch_sort_N { |
1931
|
0
|
|
|
0
|
|
|
system($^X, '-pi.bak', '-e', 's!\$sort \-n \+1!(\$sort -n -k 2 2>/dev/null || \$sort -n +1)!', 'Configure'); |
1932
|
|
|
|
|
|
|
} |
1933
|
|
|
|
|
|
|
|
1934
|
|
|
|
|
|
|
sub _patch_archive_tar_tests |
1935
|
|
|
|
|
|
|
{ |
1936
|
0
|
|
|
0
|
|
|
my $perl = shift; |
1937
|
0
|
0
|
|
|
|
|
if ($perl =~ /^5\.10/) { |
1938
|
0
|
|
|
|
|
|
_patch(<<'END'); |
1939
|
|
|
|
|
|
|
--- lib/Archive/Tar/t/02_methods.t |
1940
|
|
|
|
|
|
|
+++ lib/Archive/Tar/t/02_methods.t |
1941
|
|
|
|
|
|
|
@@ -70,6 +70,20 @@ my $LONG_FILE = qq[directory/really-really-really-really-really-really-really-re |
1942
|
|
|
|
|
|
|
my $TOO_LONG = ($^O eq 'MSWin32' or $^O eq 'cygwin' or $^O eq 'VMS') |
1943
|
|
|
|
|
|
|
&& length( cwd(). $LONG_FILE ) > 247; |
1944
|
|
|
|
|
|
|
|
1945
|
|
|
|
|
|
|
+if(!$TOO_LONG) { |
1946
|
|
|
|
|
|
|
+ my $alt = File::Spec->catfile( cwd(), $LONG_FILE); |
1947
|
|
|
|
|
|
|
+ eval 'mkpath([$alt]);'; |
1948
|
|
|
|
|
|
|
+ if($@) |
1949
|
|
|
|
|
|
|
+ { |
1950
|
|
|
|
|
|
|
+ $TOO_LONG = 1; |
1951
|
|
|
|
|
|
|
+ } |
1952
|
|
|
|
|
|
|
+ else |
1953
|
|
|
|
|
|
|
+ { |
1954
|
|
|
|
|
|
|
+ $@ = ''; |
1955
|
|
|
|
|
|
|
+ my $base = File::Spec->catfile( cwd(), 'directory'); |
1956
|
|
|
|
|
|
|
+ rmtree $base; |
1957
|
|
|
|
|
|
|
+ } |
1958
|
|
|
|
|
|
|
+} |
1959
|
|
|
|
|
|
|
### warn if we are going to skip long file names |
1960
|
|
|
|
|
|
|
if ($TOO_LONG) { |
1961
|
|
|
|
|
|
|
diag("No long filename support - long filename extraction disabled") if ! $ENV{PERL_CORE}; |
1962
|
|
|
|
|
|
|
END |
1963
|
|
|
|
|
|
|
} |
1964
|
|
|
|
|
|
|
else { |
1965
|
0
|
|
|
|
|
|
_patch(<<'END'); |
1966
|
|
|
|
|
|
|
--- cpan/Archive-Tar/t/02_methods.t |
1967
|
|
|
|
|
|
|
+++ cpan/Archive-Tar/t/02_methods.t |
1968
|
|
|
|
|
|
|
@@ -70,6 +70,20 @@ my $LONG_FILE = qq[directory/really-really-really-really-really-really-really-re |
1969
|
|
|
|
|
|
|
my $TOO_LONG = ($^O eq 'MSWin32' or $^O eq 'cygwin' or $^O eq 'VMS') |
1970
|
|
|
|
|
|
|
&& length( cwd(). $LONG_FILE ) > 247; |
1971
|
|
|
|
|
|
|
|
1972
|
|
|
|
|
|
|
+if(!$TOO_LONG) { |
1973
|
|
|
|
|
|
|
+ my $alt = File::Spec->catfile( cwd(), $LONG_FILE); |
1974
|
|
|
|
|
|
|
+ eval 'mkpath([$alt]);'; |
1975
|
|
|
|
|
|
|
+ if($@) |
1976
|
|
|
|
|
|
|
+ { |
1977
|
|
|
|
|
|
|
+ $TOO_LONG = 1; |
1978
|
|
|
|
|
|
|
+ } |
1979
|
|
|
|
|
|
|
+ else |
1980
|
|
|
|
|
|
|
+ { |
1981
|
|
|
|
|
|
|
+ $@ = ''; |
1982
|
|
|
|
|
|
|
+ my $base = File::Spec->catfile( cwd(), 'directory'); |
1983
|
|
|
|
|
|
|
+ rmtree $base; |
1984
|
|
|
|
|
|
|
+ } |
1985
|
|
|
|
|
|
|
+} |
1986
|
|
|
|
|
|
|
### warn if we are going to skip long file names |
1987
|
|
|
|
|
|
|
if ($TOO_LONG) { |
1988
|
|
|
|
|
|
|
diag("No long filename support - long filename extraction disabled") if ! $ENV{PERL_CORE}; |
1989
|
|
|
|
|
|
|
END |
1990
|
|
|
|
|
|
|
} |
1991
|
|
|
|
|
|
|
} |
1992
|
|
|
|
|
|
|
|
1993
|
|
|
|
|
|
|
sub _patch_odbm_file_hints_linux |
1994
|
|
|
|
|
|
|
{ |
1995
|
0
|
|
|
0
|
|
|
_patch(<<'END'); |
1996
|
|
|
|
|
|
|
--- ext/ODBM_File/hints/linux.pl |
1997
|
|
|
|
|
|
|
+++ ext/ODBM_File/hints/linux.pl |
1998
|
|
|
|
|
|
|
@@ -1,8 +1,8 @@ |
1999
|
|
|
|
|
|
|
# uses GDBM dbm compatibility feature - at least on SuSE 8.0 |
2000
|
|
|
|
|
|
|
$self->{LIBS} = ['-lgdbm']; |
2001
|
|
|
|
|
|
|
|
2002
|
|
|
|
|
|
|
-# Debian/Ubuntu have /usr/lib/libgdbm_compat.so.3* but not this file, |
2003
|
|
|
|
|
|
|
+# Debian/Ubuntu have libgdbm_compat.so but not this file, |
2004
|
|
|
|
|
|
|
# so linking may fail |
2005
|
|
|
|
|
|
|
-if (-e '/usr/lib/libgdbm_compat.so' or -e '/usr/lib64/libgdbm_compat.so') { |
2006
|
|
|
|
|
|
|
- $self->{LIBS}->[0] .= ' -lgdbm_compat'; |
2007
|
|
|
|
|
|
|
+foreach (split / /, $Config{libpth}) { |
2008
|
|
|
|
|
|
|
+ $self->{LIBS}->[0] .= ' -lgdbm_compat' if -e $_.'/libgdbm_compat.so'; |
2009
|
|
|
|
|
|
|
} |
2010
|
|
|
|
|
|
|
END |
2011
|
|
|
|
|
|
|
} |
2012
|
|
|
|
|
|
|
|
2013
|
|
|
|
|
|
|
sub _patch_make_ext_pl |
2014
|
|
|
|
|
|
|
{ |
2015
|
0
|
|
|
0
|
|
|
_patch(<<'END'); |
2016
|
|
|
|
|
|
|
--- make_ext.pl |
2017
|
|
|
|
|
|
|
+++ make_ext.pl |
2018
|
|
|
|
|
|
|
@@ -377,6 +377,10 @@ WriteMakefile( |
2019
|
|
|
|
|
|
|
EOM |
2020
|
|
|
|
|
|
|
close $fh or die "Can't close Makefile.PL: $!"; |
2021
|
|
|
|
|
|
|
} |
2022
|
|
|
|
|
|
|
+ eval { |
2023
|
|
|
|
|
|
|
+ my $ftime = time - 4; |
2024
|
|
|
|
|
|
|
+ utime $ftime, $ftime, 'Makefile.PL'; |
2025
|
|
|
|
|
|
|
+ }; |
2026
|
|
|
|
|
|
|
print "\nRunning Makefile.PL in $ext_dir\n"; |
2027
|
|
|
|
|
|
|
|
2028
|
|
|
|
|
|
|
# Presumably this can be simplified |
2029
|
|
|
|
|
|
|
END |
2030
|
|
|
|
|
|
|
} |
2031
|
|
|
|
|
|
|
|
2032
|
|
|
|
|
|
|
sub _patch_589_perlio_c |
2033
|
|
|
|
|
|
|
{ |
2034
|
0
|
|
|
0
|
|
|
_patch(<<'END'); |
2035
|
|
|
|
|
|
|
--- perlio.c |
2036
|
|
|
|
|
|
|
+++ perlio.c |
2037
|
|
|
|
|
|
|
@@ -2323,6 +2323,12 @@ PerlIO_init(pTHX) |
2038
|
|
|
|
|
|
|
{ |
2039
|
|
|
|
|
|
|
/* MUTEX_INIT(&PL_perlio_mutex) is done in PERL_SYS_INIT3(). */ |
2040
|
|
|
|
|
|
|
PERL_UNUSED_CONTEXT; |
2041
|
|
|
|
|
|
|
+ /* |
2042
|
|
|
|
|
|
|
+ * No, for backwards compatibility (before PERL_SYS_INIT3 changed to be |
2043
|
|
|
|
|
|
|
+ * defined as a separate function call), we need to call |
2044
|
|
|
|
|
|
|
+ * MUTEX_INIT(&PL_perlio_mutex) (via the PERLIO_INIT macro). |
2045
|
|
|
|
|
|
|
+ */ |
2046
|
|
|
|
|
|
|
+ PERLIO_INIT; |
2047
|
|
|
|
|
|
|
} |
2048
|
|
|
|
|
|
|
|
2049
|
|
|
|
|
|
|
void |
2050
|
|
|
|
|
|
|
END |
2051
|
|
|
|
|
|
|
} |
2052
|
|
|
|
|
|
|
|
2053
|
|
|
|
|
|
|
# http://perl5.git.perl.org/perl.git/commit/2674b61957c26a4924831d5110afa454ae7ae5a6 |
2054
|
|
|
|
|
|
|
sub _patch_hsplit_rehash_58 |
2055
|
|
|
|
|
|
|
{ |
2056
|
0
|
|
|
0
|
|
|
my $perl = shift; |
2057
|
|
|
|
|
|
|
|
2058
|
0
|
|
|
|
|
|
my $patch = <<'END'; |
2059
|
|
|
|
|
|
|
--- hv.c |
2060
|
|
|
|
|
|
|
+++ hv.c |
2061
|
|
|
|
|
|
|
@@ -31,7 +31,8 @@ holds the key and hash value. |
2062
|
|
|
|
|
|
|
#define PERL_HASH_INTERNAL_ACCESS |
2063
|
|
|
|
|
|
|
#include "perl.h" |
2064
|
|
|
|
|
|
|
|
2065
|
|
|
|
|
|
|
-#define HV_MAX_LENGTH_BEFORE_SPLIT 14 |
2066
|
|
|
|
|
|
|
+#define HV_MAX_LENGTH_BEFORE_REHASH 14 |
2067
|
|
|
|
|
|
|
+#define SHOULD_DO_HSPLIT(xhv) ((xhv)->xhv_keys > (xhv)->xhv_max) /* HvTOTALKEYS(hv) > HvMAX(hv) */ |
2068
|
|
|
|
|
|
|
|
2069
|
|
|
|
|
|
|
STATIC void |
2070
|
|
|
|
|
|
|
S_more_he(pTHX) |
2071
|
|
|
|
|
|
|
@@ -705,23 +706,8 @@ Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen, |
2072
|
|
|
|
|
|
|
xhv->xhv_keys++; /* HvTOTALKEYS(hv)++ */ |
2073
|
|
|
|
|
|
|
if (!counter) { /* initial entry? */ |
2074
|
|
|
|
|
|
|
xhv->xhv_fill++; /* HvFILL(hv)++ */ |
2075
|
|
|
|
|
|
|
- } else if (xhv->xhv_keys > (IV)xhv->xhv_max) { |
2076
|
|
|
|
|
|
|
+ } else if ( SHOULD_DO_HSPLIT(xhv) ) { |
2077
|
|
|
|
|
|
|
hsplit(hv); |
2078
|
|
|
|
|
|
|
- } else if(!HvREHASH(hv)) { |
2079
|
|
|
|
|
|
|
- U32 n_links = 1; |
2080
|
|
|
|
|
|
|
- |
2081
|
|
|
|
|
|
|
- while ((counter = HeNEXT(counter))) |
2082
|
|
|
|
|
|
|
- n_links++; |
2083
|
|
|
|
|
|
|
- |
2084
|
|
|
|
|
|
|
- if (n_links > HV_MAX_LENGTH_BEFORE_SPLIT) { |
2085
|
|
|
|
|
|
|
- /* Use only the old HvKEYS(hv) > HvMAX(hv) condition to limit |
2086
|
|
|
|
|
|
|
- bucket splits on a rehashed hash, as we're not going to |
2087
|
|
|
|
|
|
|
- split it again, and if someone is lucky (evil) enough to |
2088
|
|
|
|
|
|
|
- get all the keys in one list they could exhaust our memory |
2089
|
|
|
|
|
|
|
- as we repeatedly double the number of buckets on every |
2090
|
|
|
|
|
|
|
- entry. Linear search feels a less worse thing to do. */ |
2091
|
|
|
|
|
|
|
- hsplit(hv); |
2092
|
|
|
|
|
|
|
- } |
2093
|
|
|
|
|
|
|
} |
2094
|
|
|
|
|
|
|
} |
2095
|
|
|
|
|
|
|
|
2096
|
|
|
|
|
|
|
@@ -1048,7 +1034,7 @@ S_hsplit(pTHX_ HV *hv) |
2097
|
|
|
|
|
|
|
|
2098
|
|
|
|
|
|
|
|
2099
|
|
|
|
|
|
|
/* Pick your policy for "hashing isn't working" here: */ |
2100
|
|
|
|
|
|
|
- if (longest_chain <= HV_MAX_LENGTH_BEFORE_SPLIT /* split worked? */ |
2101
|
|
|
|
|
|
|
+ if (longest_chain <= HV_MAX_LENGTH_BEFORE_REHASH /* split worked? */ |
2102
|
|
|
|
|
|
|
|| HvREHASH(hv)) { |
2103
|
|
|
|
|
|
|
return; |
2104
|
|
|
|
|
|
|
} |
2105
|
|
|
|
|
|
|
@@ -1966,8 +1952,8 @@ S_share_hek_flags(pTHX_ const char *str, I32 len, register U32 hash, int flags) |
2106
|
|
|
|
|
|
|
xhv->xhv_keys++; /* HvTOTALKEYS(hv)++ */ |
2107
|
|
|
|
|
|
|
if (!next) { /* initial entry? */ |
2108
|
|
|
|
|
|
|
xhv->xhv_fill++; /* HvFILL(hv)++ */ |
2109
|
|
|
|
|
|
|
- } else if (xhv->xhv_keys > (IV)xhv->xhv_max /* HvKEYS(hv) > HvMAX(hv) */) { |
2110
|
|
|
|
|
|
|
- hsplit(PL_strtab); |
2111
|
|
|
|
|
|
|
+ } else if ( SHOULD_DO_HSPLIT(xhv) ) { |
2112
|
|
|
|
|
|
|
+ hsplit(PL_strtab); |
2113
|
|
|
|
|
|
|
} |
2114
|
|
|
|
|
|
|
} |
2115
|
|
|
|
|
|
|
|
2116
|
|
|
|
|
|
|
--- t/op/hash.t |
2117
|
|
|
|
|
|
|
+++ t/op/hash.t |
2118
|
|
|
|
|
|
|
@@ -39,22 +39,36 @@ use constant THRESHOLD => 14; |
2119
|
|
|
|
|
|
|
use constant START => "a"; |
2120
|
|
|
|
|
|
|
|
2121
|
|
|
|
|
|
|
# some initial hash data |
2122
|
|
|
|
|
|
|
-my %h2 = map {$_ => 1} 'a'..'cc'; |
2123
|
|
|
|
|
|
|
+my %h2; |
2124
|
|
|
|
|
|
|
+my $counter= "a"; |
2125
|
|
|
|
|
|
|
+$h2{$counter++}++ while $counter ne 'cd'; |
2126
|
|
|
|
|
|
|
|
2127
|
|
|
|
|
|
|
ok (!Internals::HvREHASH(%h2), |
2128
|
|
|
|
|
|
|
"starting with pre-populated non-pathological hash (rehash flag if off)"); |
2129
|
|
|
|
|
|
|
|
2130
|
|
|
|
|
|
|
my @keys = get_keys(\%h2); |
2131
|
|
|
|
|
|
|
+my $buckets= buckets(\%h2); |
2132
|
|
|
|
|
|
|
$h2{$_}++ for @keys; |
2133
|
|
|
|
|
|
|
+$h2{$counter++}++ while buckets(\%h2) == $buckets; # force a split |
2134
|
|
|
|
|
|
|
ok (Internals::HvREHASH(%h2), |
2135
|
|
|
|
|
|
|
- scalar(@keys) . " colliding into the same bucket keys are triggering rehash"); |
2136
|
|
|
|
|
|
|
+ scalar(@keys) . " colliding into the same bucket keys are triggering rehash after split"); |
2137
|
|
|
|
|
|
|
+ |
2138
|
|
|
|
|
|
|
+# returns the number of buckets in a hash |
2139
|
|
|
|
|
|
|
+sub buckets { |
2140
|
|
|
|
|
|
|
+ my $hr = shift; |
2141
|
|
|
|
|
|
|
+ my $keys_buckets= scalar(%$hr); |
2142
|
|
|
|
|
|
|
+ if ($keys_buckets=~m!/([0-9]+)\z!) { |
2143
|
|
|
|
|
|
|
+ return 0+$1; |
2144
|
|
|
|
|
|
|
+ } else { |
2145
|
|
|
|
|
|
|
+ return 8; |
2146
|
|
|
|
|
|
|
+ } |
2147
|
|
|
|
|
|
|
+} |
2148
|
|
|
|
|
|
|
|
2149
|
|
|
|
|
|
|
sub get_keys { |
2150
|
|
|
|
|
|
|
my $hr = shift; |
2151
|
|
|
|
|
|
|
|
2152
|
|
|
|
|
|
|
# the minimum of bits required to mount the attack on a hash |
2153
|
|
|
|
|
|
|
my $min_bits = log(THRESHOLD)/log(2); |
2154
|
|
|
|
|
|
|
- |
2155
|
|
|
|
|
|
|
# if the hash has already been populated with a significant amount |
2156
|
|
|
|
|
|
|
# of entries the number of mask bits can be higher |
2157
|
|
|
|
|
|
|
my $keys = scalar keys %$hr; |
2158
|
|
|
|
|
|
|
-- |
2159
|
|
|
|
|
|
|
1.7.4.1 |
2160
|
|
|
|
|
|
|
|
2161
|
|
|
|
|
|
|
END |
2162
|
|
|
|
|
|
|
|
2163
|
0
|
0
|
|
|
|
|
if ($perl =~ qr/^5\.8\.8$/) { |
2164
|
0
|
|
|
|
|
|
$patch =~ s/non-pathological/non-pathalogical/; |
2165
|
0
|
|
|
|
|
|
$patch =~ s/triggering/triggerring/; |
2166
|
|
|
|
|
|
|
} |
2167
|
0
|
|
|
|
|
|
_patch($patch); |
2168
|
|
|
|
|
|
|
} |
2169
|
|
|
|
|
|
|
|
2170
|
|
|
|
|
|
|
# http://perl5.git.perl.org/perl.git/commit/f14269908e5f8b4cab4b55643d7dd9de577e7918 |
2171
|
|
|
|
|
|
|
# http://perl5.git.perl.org/perl.git/commit/9d83adcdf9ab3c1ac7d54d76f3944e57278f0e70 |
2172
|
|
|
|
|
|
|
sub _patch_hsplit_rehash_510 { |
2173
|
0
|
|
|
0
|
|
|
_patch(<<'END'); |
2174
|
|
|
|
|
|
|
--- ext/Hash-Util-FieldHash/t/10_hash.t |
2175
|
|
|
|
|
|
|
+++ ext/Hash-Util-FieldHash/t/10_hash.t |
2176
|
|
|
|
|
|
|
@@ -46,15 +46,29 @@ use constant START => "a"; |
2177
|
|
|
|
|
|
|
|
2178
|
|
|
|
|
|
|
# some initial hash data |
2179
|
|
|
|
|
|
|
fieldhash my %h2; |
2180
|
|
|
|
|
|
|
-%h2 = map {$_ => 1} 'a'..'cc'; |
2181
|
|
|
|
|
|
|
+my $counter= "a"; |
2182
|
|
|
|
|
|
|
+$h2{$counter++}++ while $counter ne 'cd'; |
2183
|
|
|
|
|
|
|
|
2184
|
|
|
|
|
|
|
ok (!Internals::HvREHASH(%h2), |
2185
|
|
|
|
|
|
|
"starting with pre-populated non-pathological hash (rehash flag if off)"); |
2186
|
|
|
|
|
|
|
|
2187
|
|
|
|
|
|
|
my @keys = get_keys(\%h2); |
2188
|
|
|
|
|
|
|
+my $buckets= buckets(\%h2); |
2189
|
|
|
|
|
|
|
$h2{$_}++ for @keys; |
2190
|
|
|
|
|
|
|
+$h2{$counter++}++ while buckets(\%h2) == $buckets; # force a split |
2191
|
|
|
|
|
|
|
ok (Internals::HvREHASH(%h2), |
2192
|
|
|
|
|
|
|
- scalar(@keys) . " colliding into the same bucket keys are triggering rehash"); |
2193
|
|
|
|
|
|
|
+ scalar(@keys) . " colliding into the same bucket keys are triggering rehash after split"); |
2194
|
|
|
|
|
|
|
+ |
2195
|
|
|
|
|
|
|
+# returns the number of buckets in a hash |
2196
|
|
|
|
|
|
|
+sub buckets { |
2197
|
|
|
|
|
|
|
+ my $hr = shift; |
2198
|
|
|
|
|
|
|
+ my $keys_buckets= scalar(%$hr); |
2199
|
|
|
|
|
|
|
+ if ($keys_buckets=~m!/([0-9]+)\z!) { |
2200
|
|
|
|
|
|
|
+ return 0+$1; |
2201
|
|
|
|
|
|
|
+ } else { |
2202
|
|
|
|
|
|
|
+ return 8; |
2203
|
|
|
|
|
|
|
+ } |
2204
|
|
|
|
|
|
|
+} |
2205
|
|
|
|
|
|
|
|
2206
|
|
|
|
|
|
|
sub get_keys { |
2207
|
|
|
|
|
|
|
my $hr = shift; |
2208
|
|
|
|
|
|
|
--- hv.c |
2209
|
|
|
|
|
|
|
+++ hv.c |
2210
|
|
|
|
|
|
|
@@ -35,7 +35,8 @@ holds the key and hash value. |
2211
|
|
|
|
|
|
|
#define PERL_HASH_INTERNAL_ACCESS |
2212
|
|
|
|
|
|
|
#include "perl.h" |
2213
|
|
|
|
|
|
|
|
2214
|
|
|
|
|
|
|
-#define HV_MAX_LENGTH_BEFORE_SPLIT 14 |
2215
|
|
|
|
|
|
|
+#define HV_MAX_LENGTH_BEFORE_REHASH 14 |
2216
|
|
|
|
|
|
|
+#define SHOULD_DO_HSPLIT(xhv) ((xhv)->xhv_keys > (xhv)->xhv_max) /* HvTOTALKEYS(hv) > HvMAX(hv) */ |
2217
|
|
|
|
|
|
|
|
2218
|
|
|
|
|
|
|
static const char S_strtab_error[] |
2219
|
|
|
|
|
|
|
= "Cannot modify shared string table in hv_%s"; |
2220
|
|
|
|
|
|
|
@@ -818,23 +819,8 @@ Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen, |
2221
|
|
|
|
|
|
|
xhv->xhv_keys++; /* HvTOTALKEYS(hv)++ */ |
2222
|
|
|
|
|
|
|
if (!counter) { /* initial entry? */ |
2223
|
|
|
|
|
|
|
xhv->xhv_fill++; /* HvFILL(hv)++ */ |
2224
|
|
|
|
|
|
|
- } else if (xhv->xhv_keys > (IV)xhv->xhv_max) { |
2225
|
|
|
|
|
|
|
+ } else if ( SHOULD_DO_HSPLIT(xhv) ) { |
2226
|
|
|
|
|
|
|
hsplit(hv); |
2227
|
|
|
|
|
|
|
- } else if(!HvREHASH(hv)) { |
2228
|
|
|
|
|
|
|
- U32 n_links = 1; |
2229
|
|
|
|
|
|
|
- |
2230
|
|
|
|
|
|
|
- while ((counter = HeNEXT(counter))) |
2231
|
|
|
|
|
|
|
- n_links++; |
2232
|
|
|
|
|
|
|
- |
2233
|
|
|
|
|
|
|
- if (n_links > HV_MAX_LENGTH_BEFORE_SPLIT) { |
2234
|
|
|
|
|
|
|
- /* Use only the old HvKEYS(hv) > HvMAX(hv) condition to limit |
2235
|
|
|
|
|
|
|
- bucket splits on a rehashed hash, as we're not going to |
2236
|
|
|
|
|
|
|
- split it again, and if someone is lucky (evil) enough to |
2237
|
|
|
|
|
|
|
- get all the keys in one list they could exhaust our memory |
2238
|
|
|
|
|
|
|
- as we repeatedly double the number of buckets on every |
2239
|
|
|
|
|
|
|
- entry. Linear search feels a less worse thing to do. */ |
2240
|
|
|
|
|
|
|
- hsplit(hv); |
2241
|
|
|
|
|
|
|
- } |
2242
|
|
|
|
|
|
|
} |
2243
|
|
|
|
|
|
|
} |
2244
|
|
|
|
|
|
|
|
2245
|
|
|
|
|
|
|
@@ -1180,7 +1166,7 @@ S_hsplit(pTHX_ HV *hv) |
2246
|
|
|
|
|
|
|
|
2247
|
|
|
|
|
|
|
|
2248
|
|
|
|
|
|
|
/* Pick your policy for "hashing isn't working" here: */ |
2249
|
|
|
|
|
|
|
- if (longest_chain <= HV_MAX_LENGTH_BEFORE_SPLIT /* split worked? */ |
2250
|
|
|
|
|
|
|
+ if (longest_chain <= HV_MAX_LENGTH_BEFORE_REHASH /* split worked? */ |
2251
|
|
|
|
|
|
|
|| HvREHASH(hv)) { |
2252
|
|
|
|
|
|
|
return; |
2253
|
|
|
|
|
|
|
} |
2254
|
|
|
|
|
|
|
@@ -2506,8 +2492,8 @@ S_share_hek_flags(pTHX_ const char *str, I32 len, register U32 hash, int flags) |
2255
|
|
|
|
|
|
|
xhv->xhv_keys++; /* HvTOTALKEYS(hv)++ */ |
2256
|
|
|
|
|
|
|
if (!next) { /* initial entry? */ |
2257
|
|
|
|
|
|
|
xhv->xhv_fill++; /* HvFILL(hv)++ */ |
2258
|
|
|
|
|
|
|
- } else if (xhv->xhv_keys > (IV)xhv->xhv_max /* HvKEYS(hv) > HvMAX(hv) */) { |
2259
|
|
|
|
|
|
|
- hsplit(PL_strtab); |
2260
|
|
|
|
|
|
|
+ } else if ( SHOULD_DO_HSPLIT(xhv) ) { |
2261
|
|
|
|
|
|
|
+ hsplit(PL_strtab); |
2262
|
|
|
|
|
|
|
} |
2263
|
|
|
|
|
|
|
} |
2264
|
|
|
|
|
|
|
|
2265
|
|
|
|
|
|
|
diff --git a/t/op/hash.t b/t/op/hash.t |
2266
|
|
|
|
|
|
|
index 9bde518..45eb782 100644 |
2267
|
|
|
|
|
|
|
--- t/op/hash.t |
2268
|
|
|
|
|
|
|
+++ t/op/hash.t |
2269
|
|
|
|
|
|
|
@@ -39,22 +39,36 @@ use constant THRESHOLD => 14; |
2270
|
|
|
|
|
|
|
use constant START => "a"; |
2271
|
|
|
|
|
|
|
|
2272
|
|
|
|
|
|
|
# some initial hash data |
2273
|
|
|
|
|
|
|
-my %h2 = map {$_ => 1} 'a'..'cc'; |
2274
|
|
|
|
|
|
|
+my %h2; |
2275
|
|
|
|
|
|
|
+my $counter= "a"; |
2276
|
|
|
|
|
|
|
+$h2{$counter++}++ while $counter ne 'cd'; |
2277
|
|
|
|
|
|
|
|
2278
|
|
|
|
|
|
|
ok (!Internals::HvREHASH(%h2), |
2279
|
|
|
|
|
|
|
"starting with pre-populated non-pathological hash (rehash flag if off)"); |
2280
|
|
|
|
|
|
|
|
2281
|
|
|
|
|
|
|
my @keys = get_keys(\%h2); |
2282
|
|
|
|
|
|
|
+my $buckets= buckets(\%h2); |
2283
|
|
|
|
|
|
|
$h2{$_}++ for @keys; |
2284
|
|
|
|
|
|
|
+$h2{$counter++}++ while buckets(\%h2) == $buckets; # force a split |
2285
|
|
|
|
|
|
|
ok (Internals::HvREHASH(%h2), |
2286
|
|
|
|
|
|
|
- scalar(@keys) . " colliding into the same bucket keys are triggering rehash"); |
2287
|
|
|
|
|
|
|
+ scalar(@keys) . " colliding into the same bucket keys are triggering rehash after split"); |
2288
|
|
|
|
|
|
|
+ |
2289
|
|
|
|
|
|
|
+# returns the number of buckets in a hash |
2290
|
|
|
|
|
|
|
+sub buckets { |
2291
|
|
|
|
|
|
|
+ my $hr = shift; |
2292
|
|
|
|
|
|
|
+ my $keys_buckets= scalar(%$hr); |
2293
|
|
|
|
|
|
|
+ if ($keys_buckets=~m!/([0-9]+)\z!) { |
2294
|
|
|
|
|
|
|
+ return 0+$1; |
2295
|
|
|
|
|
|
|
+ } else { |
2296
|
|
|
|
|
|
|
+ return 8; |
2297
|
|
|
|
|
|
|
+ } |
2298
|
|
|
|
|
|
|
+} |
2299
|
|
|
|
|
|
|
|
2300
|
|
|
|
|
|
|
sub get_keys { |
2301
|
|
|
|
|
|
|
my $hr = shift; |
2302
|
|
|
|
|
|
|
|
2303
|
|
|
|
|
|
|
# the minimum of bits required to mount the attack on a hash |
2304
|
|
|
|
|
|
|
my $min_bits = log(THRESHOLD)/log(2); |
2305
|
|
|
|
|
|
|
- |
2306
|
|
|
|
|
|
|
# if the hash has already been populated with a significant amount |
2307
|
|
|
|
|
|
|
# of entries the number of mask bits can be higher |
2308
|
|
|
|
|
|
|
my $keys = scalar keys %$hr; |
2309
|
|
|
|
|
|
|
-- |
2310
|
|
|
|
|
|
|
1.7.4.1 |
2311
|
|
|
|
|
|
|
|
2312
|
|
|
|
|
|
|
|
2313
|
|
|
|
|
|
|
END |
2314
|
|
|
|
|
|
|
} |
2315
|
|
|
|
|
|
|
|
2316
|
|
|
|
|
|
|
sub _patch_bitrig { |
2317
|
0
|
0
|
|
0
|
|
|
return unless $^O eq 'bitrig'; |
2318
|
0
|
|
|
|
|
|
my $perlver = shift; |
2319
|
0
|
|
|
|
|
|
my $num = _norm_ver( $perlver ); |
2320
|
0
|
0
|
|
|
|
|
return unless $num < 5.019004; |
2321
|
0
|
0
|
|
|
|
|
unless ( $num < 5.00800 ) { |
2322
|
0
|
|
|
|
|
|
_patch(<<'BOOGLE'); |
2323
|
|
|
|
|
|
|
diff --git a/Configure b/Configure |
2324
|
|
|
|
|
|
|
index 19bed50..e4e4075 100755 |
2325
|
|
|
|
|
|
|
--- Configure |
2326
|
|
|
|
|
|
|
+++ Configure |
2327
|
|
|
|
|
|
|
@@ -3312,6 +3312,9 @@ EOM |
2328
|
|
|
|
|
|
|
;; |
2329
|
|
|
|
|
|
|
next*) osname=next ;; |
2330
|
|
|
|
|
|
|
nonstop-ux) osname=nonstopux ;; |
2331
|
|
|
|
|
|
|
+ bitrig) osname=bitrig |
2332
|
|
|
|
|
|
|
+ osvers="$3" |
2333
|
|
|
|
|
|
|
+ ;; |
2334
|
|
|
|
|
|
|
openbsd) osname=openbsd |
2335
|
|
|
|
|
|
|
osvers="$3" |
2336
|
|
|
|
|
|
|
;; |
2337
|
|
|
|
|
|
|
BOOGLE |
2338
|
|
|
|
|
|
|
} |
2339
|
0
|
0
|
|
|
|
|
if ( $num < 5.008009 ) { |
2340
|
0
|
|
|
|
|
|
_patch(<<'BITRIGM1'); |
2341
|
|
|
|
|
|
|
diff --git a/Makefile.SH b/Makefile.SH |
2342
|
|
|
|
|
|
|
index 17298fa..ecaa8ac 100755 |
2343
|
|
|
|
|
|
|
--- Makefile.SH |
2344
|
|
|
|
|
|
|
+++ Makefile.SH |
2345
|
|
|
|
|
|
|
@@ -77,7 +77,7 @@ true) |
2346
|
|
|
|
|
|
|
sunos*) |
2347
|
|
|
|
|
|
|
linklibperl="-lperl" |
2348
|
|
|
|
|
|
|
;; |
2349
|
|
|
|
|
|
|
- netbsd*|freebsd[234]*|openbsd*) |
2350
|
|
|
|
|
|
|
+ netbsd*|freebsd[234]*|openbsd*|bitrig*) |
2351
|
|
|
|
|
|
|
linklibperl="-L. -lperl" |
2352
|
|
|
|
|
|
|
;; |
2353
|
|
|
|
|
|
|
interix*) |
2354
|
|
|
|
|
|
|
BITRIGM1 |
2355
|
|
|
|
|
|
|
} |
2356
|
|
|
|
|
|
|
else { |
2357
|
0
|
|
|
|
|
|
_patch(<<'BITRIGMX'); |
2358
|
|
|
|
|
|
|
diff --git a/Makefile.SH b/Makefile.SH |
2359
|
|
|
|
|
|
|
index 17298fa..ecaa8ac 100755 |
2360
|
|
|
|
|
|
|
--- Makefile.SH |
2361
|
|
|
|
|
|
|
+++ Makefile.SH |
2362
|
|
|
|
|
|
|
@@ -77,7 +77,7 @@ true) |
2363
|
|
|
|
|
|
|
sunos*) |
2364
|
|
|
|
|
|
|
linklibperl="-lperl" |
2365
|
|
|
|
|
|
|
;; |
2366
|
|
|
|
|
|
|
- netbsd*|freebsd[234]*|openbsd*|dragonfly*) |
2367
|
|
|
|
|
|
|
+ netbsd*|freebsd[234]*|openbsd*|dragonfly*|bitrig*) |
2368
|
|
|
|
|
|
|
linklibperl="-L. -lperl" |
2369
|
|
|
|
|
|
|
;; |
2370
|
|
|
|
|
|
|
interix*) |
2371
|
|
|
|
|
|
|
BITRIGMX |
2372
|
|
|
|
|
|
|
} |
2373
|
0
|
0
|
|
|
|
|
if ( $num < 5.008001 ) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2374
|
|
|
|
|
|
|
# NOOP |
2375
|
|
|
|
|
|
|
} |
2376
|
|
|
|
|
|
|
elsif ( $num < 5.008007 ) { |
2377
|
0
|
|
|
|
|
|
_patch(<<'BITRIGC3'); |
2378
|
|
|
|
|
|
|
diff --git a/Configure b/Configure |
2379
|
|
|
|
|
|
|
index 19bed50..e4e4075 100755 |
2380
|
|
|
|
|
|
|
--- Configure Thu Aug 22 23:20:14 2013 |
2381
|
|
|
|
|
|
|
+++ Configure Thu Aug 22 23:20:35 2013 |
2382
|
|
|
|
|
|
|
@@ -7855,7 +7855,7 @@ |
2383
|
|
|
|
|
|
|
solaris) |
2384
|
|
|
|
|
|
|
xxx="-R $shrpdir" |
2385
|
|
|
|
|
|
|
;; |
2386
|
|
|
|
|
|
|
- freebsd|netbsd|openbsd) |
2387
|
|
|
|
|
|
|
+ freebsd|netbsd|openbsd|bitrig) |
2388
|
|
|
|
|
|
|
xxx="-Wl,-R$shrpdir" |
2389
|
|
|
|
|
|
|
;; |
2390
|
|
|
|
|
|
|
bsdos|linux|irix*|dec_osf) |
2391
|
|
|
|
|
|
|
BITRIGC3 |
2392
|
|
|
|
|
|
|
} |
2393
|
|
|
|
|
|
|
elsif ( $num < 5.008009 ) { |
2394
|
0
|
|
|
|
|
|
_patch(<<'BITRIGC2'); |
2395
|
|
|
|
|
|
|
diff --git a/Configure b/Configure |
2396
|
|
|
|
|
|
|
index 19bed50..e4e4075 100755 |
2397
|
|
|
|
|
|
|
--- Configure Thu Aug 22 22:56:04 2013 |
2398
|
|
|
|
|
|
|
+++ Configure Thu Aug 22 22:56:25 2013 |
2399
|
|
|
|
|
|
|
@@ -7892,7 +7892,7 @@ |
2400
|
|
|
|
|
|
|
solaris) |
2401
|
|
|
|
|
|
|
xxx="-R $shrpdir" |
2402
|
|
|
|
|
|
|
;; |
2403
|
|
|
|
|
|
|
- freebsd|netbsd|openbsd|interix) |
2404
|
|
|
|
|
|
|
+ freebsd|netbsd|openbsd|interix|bitrig) |
2405
|
|
|
|
|
|
|
xxx="-Wl,-R$shrpdir" |
2406
|
|
|
|
|
|
|
;; |
2407
|
|
|
|
|
|
|
bsdos|linux|irix*|dec_osf|gnu*) |
2408
|
|
|
|
|
|
|
BITRIGC2 |
2409
|
|
|
|
|
|
|
} |
2410
|
|
|
|
|
|
|
elsif ( $num < 5.013000 ) { |
2411
|
0
|
|
|
|
|
|
_patch(<<'BITRIGC1'); |
2412
|
|
|
|
|
|
|
diff --git a/Configure b/Configure |
2413
|
|
|
|
|
|
|
index 19bed50..e4e4075 100755 |
2414
|
|
|
|
|
|
|
--- Configure |
2415
|
|
|
|
|
|
|
+++ Configure |
2416
|
|
|
|
|
|
|
@@ -8328,7 +8331,7 @@ if "$useshrplib"; then |
2417
|
|
|
|
|
|
|
solaris) |
2418
|
|
|
|
|
|
|
xxx="-R $shrpdir" |
2419
|
|
|
|
|
|
|
;; |
2420
|
|
|
|
|
|
|
- freebsd|netbsd|openbsd|interix|dragonfly) |
2421
|
|
|
|
|
|
|
+ freebsd|netbsd|openbsd|interix|dragonfly|bitrig) |
2422
|
|
|
|
|
|
|
xxx="-Wl,-R$shrpdir" |
2423
|
|
|
|
|
|
|
;; |
2424
|
|
|
|
|
|
|
bsdos|linux|irix*|dec_osf|gnu*) |
2425
|
|
|
|
|
|
|
BITRIGC1 |
2426
|
|
|
|
|
|
|
} |
2427
|
|
|
|
|
|
|
else { |
2428
|
0
|
|
|
|
|
|
_patch(<<'BITRIGCX'); |
2429
|
|
|
|
|
|
|
diff --git a/Configure b/Configure |
2430
|
|
|
|
|
|
|
index 19bed50..e4e4075 100755 |
2431
|
|
|
|
|
|
|
--- Configure |
2432
|
|
|
|
|
|
|
+++ Configure |
2433
|
|
|
|
|
|
|
@@ -8328,7 +8331,7 @@ if "$useshrplib"; then |
2434
|
|
|
|
|
|
|
solaris) |
2435
|
|
|
|
|
|
|
xxx="-R $shrpdir" |
2436
|
|
|
|
|
|
|
;; |
2437
|
|
|
|
|
|
|
- freebsd|mirbsd|netbsd|openbsd|interix|dragonfly) |
2438
|
|
|
|
|
|
|
+ freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig) |
2439
|
|
|
|
|
|
|
xxx="-Wl,-R$shrpdir" |
2440
|
|
|
|
|
|
|
;; |
2441
|
|
|
|
|
|
|
bsdos|linux|irix*|dec_osf|gnu*) |
2442
|
|
|
|
|
|
|
BITRIGCX |
2443
|
|
|
|
|
|
|
} |
2444
|
|
|
|
|
|
|
} |
2445
|
|
|
|
|
|
|
|
2446
|
|
|
|
|
|
|
sub _patch_conf_solaris { |
2447
|
0
|
0
|
|
0
|
|
|
return unless $^O eq 'solaris'; |
2448
|
0
|
|
|
|
|
|
my $perlver = shift; |
2449
|
0
|
|
|
|
|
|
my $num = _norm_ver( $perlver ); |
2450
|
0
|
0
|
|
|
|
|
return unless $num < 5.018000; |
2451
|
0
|
|
|
|
|
|
_patch(<<'BUBBLE'); |
2452
|
|
|
|
|
|
|
diff --git a/Configure b/Configure |
2453
|
|
|
|
|
|
|
index ff511d3..30ab78a 100755 |
2454
|
|
|
|
|
|
|
--- Configure |
2455
|
|
|
|
|
|
|
+++ Configure |
2456
|
|
|
|
|
|
|
@@ -8048,7 +8048,20 @@ EOM |
2457
|
|
|
|
|
|
|
;; |
2458
|
|
|
|
|
|
|
linux|irix*|gnu*) dflt="-shared $optimize" ;; |
2459
|
|
|
|
|
|
|
next) dflt='none' ;; |
2460
|
|
|
|
|
|
|
- solaris) dflt='-G' ;; |
2461
|
|
|
|
|
|
|
+ solaris) # See [perl #66604]. On Solaris 11, gcc -m64 on amd64 |
2462
|
|
|
|
|
|
|
+ # appears not to understand -G. gcc versions at |
2463
|
|
|
|
|
|
|
+ # least as old as 3.4.3 support -shared, so just |
2464
|
|
|
|
|
|
|
+ # use that with Solaris 11 and later, but keep |
2465
|
|
|
|
|
|
|
+ # the old behavior for older Solaris versions. |
2466
|
|
|
|
|
|
|
+ case "$gccversion" in |
2467
|
|
|
|
|
|
|
+ '') dflt='-G' ;; |
2468
|
|
|
|
|
|
|
+ *) case "$osvers" in |
2469
|
|
|
|
|
|
|
+ 2.?|2.10) dflt='-G' ;; |
2470
|
|
|
|
|
|
|
+ *) dflt='-shared' ;; |
2471
|
|
|
|
|
|
|
+ esac |
2472
|
|
|
|
|
|
|
+ ;; |
2473
|
|
|
|
|
|
|
+ esac |
2474
|
|
|
|
|
|
|
+ ;; |
2475
|
|
|
|
|
|
|
sunos) dflt='-assert nodefinitions' ;; |
2476
|
|
|
|
|
|
|
svr4*|esix*|nonstopux) dflt="-G $ldflags" ;; |
2477
|
|
|
|
|
|
|
*) dflt='none' ;; |
2478
|
|
|
|
|
|
|
BUBBLE |
2479
|
|
|
|
|
|
|
} |
2480
|
|
|
|
|
|
|
|
2481
|
|
|
|
|
|
|
#commit 4149c7198d9b78d861df289cce40dd865cab57e7 |
2482
|
|
|
|
|
|
|
sub _patch_regmatch_pointer_5180 { |
2483
|
0
|
|
|
0
|
|
|
_patch(<<'BOBBLE'); |
2484
|
|
|
|
|
|
|
diff --git a/regexec.c b/regexec.c |
2485
|
|
|
|
|
|
|
index bc38839..b865b46 100644 |
2486
|
|
|
|
|
|
|
--- regexec.c |
2487
|
|
|
|
|
|
|
+++ regexec.c |
2488
|
|
|
|
|
|
|
@@ -6662,7 +6662,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p, |
2489
|
|
|
|
|
|
|
scan = *startposp; |
2490
|
|
|
|
|
|
|
if (max == REG_INFTY) |
2491
|
|
|
|
|
|
|
max = I32_MAX; |
2492
|
|
|
|
|
|
|
- else if (! utf8_target && scan + max < loceol) |
2493
|
|
|
|
|
|
|
+ else if (! utf8_target && loceol - scan > max) |
2494
|
|
|
|
|
|
|
loceol = scan + max; |
2495
|
|
|
|
|
|
|
|
2496
|
|
|
|
|
|
|
/* Here, for the case of a non-UTF-8 target we have adjusted down |
2497
|
|
|
|
|
|
|
@@ -6711,7 +6711,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p, |
2498
|
|
|
|
|
|
|
scan = loceol; |
2499
|
|
|
|
|
|
|
break; |
2500
|
|
|
|
|
|
|
case CANY: /* Move forward bytes, unless goes off end */ |
2501
|
|
|
|
|
|
|
- if (utf8_target && scan + max < loceol) { |
2502
|
|
|
|
|
|
|
+ if (utf8_target && loceol - scan > max) { |
2503
|
|
|
|
|
|
|
|
2504
|
|
|
|
|
|
|
/* hadn't been adjusted in the UTF-8 case */ |
2505
|
|
|
|
|
|
|
scan += max; |
2506
|
|
|
|
|
|
|
@@ -6730,7 +6730,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p, |
2507
|
|
|
|
|
|
|
* can use UTF8_IS_INVARIANT() even if the pattern isn't UTF-8, as it's |
2508
|
|
|
|
|
|
|
* true iff it doesn't matter if the argument is in UTF-8 or not */ |
2509
|
|
|
|
|
|
|
if (UTF8_IS_INVARIANT(c) || (! utf8_target && ! is_utf8_pat)) { |
2510
|
|
|
|
|
|
|
- if (utf8_target && scan + max < loceol) { |
2511
|
|
|
|
|
|
|
+ if (utf8_target && loceol - scan > max) { |
2512
|
|
|
|
|
|
|
/* We didn't adjust because is UTF-8, but ok to do so, |
2513
|
|
|
|
|
|
|
* since here, to match at all, 1 char == 1 byte */ |
2514
|
|
|
|
|
|
|
loceol = scan + max; |
2515
|
|
|
|
|
|
|
@@ -6910,7 +6910,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p, |
2516
|
|
|
|
|
|
|
/* FALLTHROUGH */ |
2517
|
|
|
|
|
|
|
|
2518
|
|
|
|
|
|
|
case POSIXA: |
2519
|
|
|
|
|
|
|
- if (utf8_target && scan + max < loceol) { |
2520
|
|
|
|
|
|
|
+ if (utf8_target && loceol - scan > max) { |
2521
|
|
|
|
|
|
|
|
2522
|
|
|
|
|
|
|
/* We didn't adjust at the beginning of this routine |
2523
|
|
|
|
|
|
|
* because is UTF-8, but it is actually ok to do so, since here, to |
2524
|
|
|
|
|
|
|
diff --git a/t/re/pat_rt_report.t b/t/re/pat_rt_report.t |
2525
|
|
|
|
|
|
|
index 2244fdf..9a9b5f5 100644 |
2526
|
|
|
|
|
|
|
--- t/re/pat_rt_report.t |
2527
|
|
|
|
|
|
|
+++ t/re/pat_rt_report.t |
2528
|
|
|
|
|
|
|
@@ -22,7 +22,7 @@ BEGIN { |
2529
|
|
|
|
|
|
|
} |
2530
|
|
|
|
|
|
|
|
2531
|
|
|
|
|
|
|
|
2532
|
|
|
|
|
|
|
-plan tests => 2530; # Update this when adding/deleting tests. |
2533
|
|
|
|
|
|
|
+plan tests => 2532; # Update this when adding/deleting tests. |
2534
|
|
|
|
|
|
|
|
2535
|
|
|
|
|
|
|
run_tests() unless caller; |
2536
|
|
|
|
|
|
|
|
2537
|
|
|
|
|
|
|
@@ -1158,6 +1158,21 @@ EOP |
2538
|
|
|
|
|
|
|
'$_ = "abc"; /b/g; $_ = "hello"; print eval q|$\'|,"\n"', |
2539
|
|
|
|
|
|
|
"c\n", {}, '$\' first mentioned after match'); |
2540
|
|
|
|
|
|
|
} |
2541
|
|
|
|
|
|
|
+ |
2542
|
|
|
|
|
|
|
+ { |
2543
|
|
|
|
|
|
|
+ # [perl #118175] threaded perl-5.18.0 fails pat_rt_report_thr.t |
2544
|
|
|
|
|
|
|
+ # this tests some related failures |
2545
|
|
|
|
|
|
|
+ # |
2546
|
|
|
|
|
|
|
+ # The tests in the block *only* fail when run on 32-bit systems |
2547
|
|
|
|
|
|
|
+ # with a malloc that allocates above the 2GB line. On the system |
2548
|
|
|
|
|
|
|
+ # in the report above that only happened in a thread. |
2549
|
|
|
|
|
|
|
+ my $s = "\x{1ff}" . "f" x 32; |
2550
|
|
|
|
|
|
|
+ ok($s =~ /\x{1ff}[[:alpha:]]+/gca, "POSIXA pointer wrap"); |
2551
|
|
|
|
|
|
|
+ |
2552
|
|
|
|
|
|
|
+ # this one segfaulted under the conditions above |
2553
|
|
|
|
|
|
|
+ # of course, CANY is evil, maybe it should crash |
2554
|
|
|
|
|
|
|
+ ok($s =~ /.\C+/, "CANY pointer wrap"); |
2555
|
|
|
|
|
|
|
+ } |
2556
|
|
|
|
|
|
|
} # End of sub run_tests |
2557
|
|
|
|
|
|
|
|
2558
|
|
|
|
|
|
|
1; |
2559
|
|
|
|
|
|
|
BOBBLE |
2560
|
|
|
|
|
|
|
} |
2561
|
|
|
|
|
|
|
|
2562
|
|
|
|
|
|
|
sub _patch_makefile_sh_phony { |
2563
|
0
|
|
|
0
|
|
|
_patch(<<'END'); |
2564
|
|
|
|
|
|
|
diff --git a/Makefile.SH b/Makefile.SH |
2565
|
|
|
|
|
|
|
index ac5ade4..8e66603 100755 |
2566
|
|
|
|
|
|
|
--- Makefile.SH |
2567
|
|
|
|
|
|
|
+++ Makefile.SH |
2568
|
|
|
|
|
|
|
@@ -295,6 +295,30 @@ obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS) |
2569
|
|
|
|
|
|
|
# EMBEDDING is on by default, and MULTIPLICITY doesn't work. |
2570
|
|
|
|
|
|
|
# |
2571
|
|
|
|
|
|
|
|
2572
|
|
|
|
|
|
|
+.PHONY: all compile translators utilities \ |
2573
|
|
|
|
|
|
|
+ FORCE \ |
2574
|
|
|
|
|
|
|
+ preplibrary \ |
2575
|
|
|
|
|
|
|
+ install install-strip install-all install-verbose install-silent \ |
2576
|
|
|
|
|
|
|
+ no-install install.perl install.man installman install.html installhtml \ |
2577
|
|
|
|
|
|
|
+ check_byacc run_byacc \ |
2578
|
|
|
|
|
|
|
+ regen_headers regen_pods regen_all \ |
2579
|
|
|
|
|
|
|
+ clean _tidy _mopup _cleaner1 _cleaner2 \ |
2580
|
|
|
|
|
|
|
+ realclean _realcleaner clobber _clobber \ |
2581
|
|
|
|
|
|
|
+ distclean veryclean _verycleaner \ |
2582
|
|
|
|
|
|
|
+ lint \ |
2583
|
|
|
|
|
|
|
+ depend \ |
2584
|
|
|
|
|
|
|
+ test check test_prep _test_prep \ |
2585
|
|
|
|
|
|
|
+ test_tty test-tty _test_tty test_notty test-notty _test_notty \ |
2586
|
|
|
|
|
|
|
+ utest ucheck test.utf8 check.utf8 \ |
2587
|
|
|
|
|
|
|
+ test.third check.third utest.third ucheck.third test_notty.third \ |
2588
|
|
|
|
|
|
|
+ test.deparse test_notty.deparse \ |
2589
|
|
|
|
|
|
|
+ minitest \ |
2590
|
|
|
|
|
|
|
+ ok okfile oknack okfilenack nok nokfile noknack nokfilenack \ |
2591
|
|
|
|
|
|
|
+ clist hlist shlist pllist \ |
2592
|
|
|
|
|
|
|
+ distcheck \ |
2593
|
|
|
|
|
|
|
+ elc \ |
2594
|
|
|
|
|
|
|
+ etags ctags tags |
2595
|
|
|
|
|
|
|
+ |
2596
|
|
|
|
|
|
|
lintflags = -hbvxac |
2597
|
|
|
|
|
|
|
|
2598
|
|
|
|
|
|
|
.c$(OBJ_EXT): |
2599
|
|
|
|
|
|
|
END |
2600
|
|
|
|
|
|
|
} |
2601
|
|
|
|
|
|
|
|
2602
|
|
|
|
|
|
|
sub _patch_cow_speed { |
2603
|
0
|
|
|
0
|
|
|
_patch(<<'COWSAY'); |
2604
|
|
|
|
|
|
|
diff --git a/sv.c b/sv.c |
2605
|
|
|
|
|
|
|
index 06c0b83..ac1d972 100644 |
2606
|
|
|
|
|
|
|
--- sv.c |
2607
|
|
|
|
|
|
|
+++ sv.c |
2608
|
|
|
|
|
|
|
@@ -1574,14 +1574,19 @@ Perl_sv_grow(pTHX_ SV *const sv, STRLEN newlen) |
2609
|
|
|
|
|
|
|
newlen++; |
2610
|
|
|
|
|
|
|
#endif |
2611
|
|
|
|
|
|
|
|
2612
|
|
|
|
|
|
|
+#if defined(PERL_USE_MALLOC_SIZE) && defined(Perl_safesysmalloc_size) |
2613
|
|
|
|
|
|
|
+#define PERL_UNWARANTED_CHUMMINESS_WITH_MALLOC |
2614
|
|
|
|
|
|
|
+#endif |
2615
|
|
|
|
|
|
|
+ |
2616
|
|
|
|
|
|
|
if (newlen > SvLEN(sv)) { /* need more room? */ |
2617
|
|
|
|
|
|
|
STRLEN minlen = SvCUR(sv); |
2618
|
|
|
|
|
|
|
minlen += (minlen >> PERL_STRLEN_EXPAND_SHIFT) + 10; |
2619
|
|
|
|
|
|
|
if (newlen < minlen) |
2620
|
|
|
|
|
|
|
newlen = minlen; |
2621
|
|
|
|
|
|
|
-#ifndef Perl_safesysmalloc_size |
2622
|
|
|
|
|
|
|
- if (SvLEN(sv)) |
2623
|
|
|
|
|
|
|
+#ifndef PERL_UNWARANTED_CHUMMINESS_WITH_MALLOC |
2624
|
|
|
|
|
|
|
+ if (SvLEN(sv)) { |
2625
|
|
|
|
|
|
|
newlen = PERL_STRLEN_ROUNDUP(newlen); |
2626
|
|
|
|
|
|
|
+ } |
2627
|
|
|
|
|
|
|
#endif |
2628
|
|
|
|
|
|
|
if (SvLEN(sv) && s) { |
2629
|
|
|
|
|
|
|
s = (char*)saferealloc(s, newlen); |
2630
|
|
|
|
|
|
|
@@ -1593,7 +1598,7 @@ Perl_sv_grow(pTHX_ SV *const sv, STRLEN newlen) |
2631
|
|
|
|
|
|
|
} |
2632
|
|
|
|
|
|
|
} |
2633
|
|
|
|
|
|
|
SvPV_set(sv, s); |
2634
|
|
|
|
|
|
|
-#ifdef Perl_safesysmalloc_size |
2635
|
|
|
|
|
|
|
+#ifdef PERL_UNWARANTED_CHUMMINESS_WITH_MALLOC |
2636
|
|
|
|
|
|
|
/* Do this here, do it once, do it right, and then we will never get |
2637
|
|
|
|
|
|
|
called back into sv_grow() unless there really is some growing |
2638
|
|
|
|
|
|
|
needed. */ |
2639
|
|
|
|
|
|
|
COWSAY |
2640
|
|
|
|
|
|
|
} |
2641
|
|
|
|
|
|
|
|
2642
|
|
|
|
|
|
|
sub _patch_preprocess_options { |
2643
|
0
|
|
|
0
|
|
|
my $perl = shift; |
2644
|
|
|
|
|
|
|
|
2645
|
0
|
0
|
|
|
|
|
if ($perl =~ /^5\.(?:8|10)\./) { |
|
|
0
|
|
|
|
|
|
2646
|
0
|
|
|
|
|
|
_patch(<<'END'); |
2647
|
|
|
|
|
|
|
diff --git a/perl.c b/perl.c |
2648
|
|
|
|
|
|
|
index 82e5538..b9e02fe 100644 |
2649
|
|
|
|
|
|
|
--- perl.c |
2650
|
|
|
|
|
|
|
+++ perl.c |
2651
|
|
|
|
|
|
|
@@ -3758,7 +3758,7 @@ S_open_script(pTHX_ const char *scriptname, bool dosearch, SV *sv, |
2652
|
|
|
|
|
|
|
# ifdef VMS |
2653
|
|
|
|
|
|
|
cpp_discard_flag = ""; |
2654
|
|
|
|
|
|
|
# else |
2655
|
|
|
|
|
|
|
- cpp_discard_flag = "-C"; |
2656
|
|
|
|
|
|
|
+ cpp_discard_flag = "-C -ffreestanding"; |
2657
|
|
|
|
|
|
|
# endif |
2658
|
|
|
|
|
|
|
|
2659
|
|
|
|
|
|
|
# ifdef OS2 |
2660
|
|
|
|
|
|
|
END |
2661
|
|
|
|
|
|
|
} elsif ($perl =~ /^5\.6\./) { |
2662
|
0
|
|
|
|
|
|
_patch(<<'END'); |
2663
|
|
|
|
|
|
|
diff --git a/perl.c b/perl.c |
2664
|
|
|
|
|
|
|
index 623f9be..014d318 100644 |
2665
|
|
|
|
|
|
|
--- perl.c |
2666
|
|
|
|
|
|
|
+++ perl.c |
2667
|
|
|
|
|
|
|
@@ -2631,7 +2631,7 @@ sed %s -e \"/^[^#]/b\" \ |
2668
|
|
|
|
|
|
|
-e '/^#[ ]*undef[ ]/b' \ |
2669
|
|
|
|
|
|
|
-e '/^#[ ]*endif/b' \ |
2670
|
|
|
|
|
|
|
-e 's/^[ ]*#.*//' \ |
2671
|
|
|
|
|
|
|
- %s | %"SVf" -C %"SVf" %s", |
2672
|
|
|
|
|
|
|
+ %s | %"SVf" -C -ffreestanding %"SVf" %s", |
2673
|
|
|
|
|
|
|
# endif |
2674
|
|
|
|
|
|
|
#ifdef LOC_SED |
2675
|
|
|
|
|
|
|
LOC_SED, |
2676
|
|
|
|
|
|
|
END |
2677
|
|
|
|
|
|
|
} |
2678
|
|
|
|
|
|
|
} |
2679
|
|
|
|
|
|
|
|
2680
|
|
|
|
|
|
|
sub _patch_5183_metajson { |
2681
|
0
|
|
|
0
|
|
|
_patch(<<'DOGSAY'); |
2682
|
|
|
|
|
|
|
diff --git a/META.json b/META.json |
2683
|
|
|
|
|
|
|
index 64caea7..200e324 100644 |
2684
|
|
|
|
|
|
|
--- META.json |
2685
|
|
|
|
|
|
|
+++ META.json |
2686
|
|
|
|
|
|
|
@@ -118,7 +118,7 @@ |
2687
|
|
|
|
|
|
|
"TestInit.pm" |
2688
|
|
|
|
|
|
|
] |
2689
|
|
|
|
|
|
|
}, |
2690
|
|
|
|
|
|
|
- "release_status" : "testing", |
2691
|
|
|
|
|
|
|
+ "release_status" : "stable", |
2692
|
|
|
|
|
|
|
"resources" : { |
2693
|
|
|
|
|
|
|
"bugtracker" : { |
2694
|
|
|
|
|
|
|
"web" : "http://rt.perl.org/perlbug/" |
2695
|
|
|
|
|
|
|
DOGSAY |
2696
|
|
|
|
|
|
|
} |
2697
|
|
|
|
|
|
|
|
2698
|
|
|
|
|
|
|
sub _patch_handy { |
2699
|
0
|
|
|
0
|
|
|
_patch(<<'END'); |
2700
|
|
|
|
|
|
|
--- handy.h |
2701
|
|
|
|
|
|
|
+++ handy.h |
2702
|
|
|
|
|
|
|
@@ -43,12 +43,10 @@ |
2703
|
|
|
|
|
|
|
this file first, then you will have to manually set -DHAS_BOOL in |
2704
|
|
|
|
|
|
|
your command line to avoid a conflict. |
2705
|
|
|
|
|
|
|
*/ |
2706
|
|
|
|
|
|
|
-#ifdef _G_HAVE_BOOL |
2707
|
|
|
|
|
|
|
-# if _G_HAVE_BOOL |
2708
|
|
|
|
|
|
|
+#ifdef __GNUG__ |
2709
|
|
|
|
|
|
|
# ifndef HAS_BOOL |
2710
|
|
|
|
|
|
|
# define HAS_BOOL 1 |
2711
|
|
|
|
|
|
|
# endif |
2712
|
|
|
|
|
|
|
-# endif |
2713
|
|
|
|
|
|
|
#endif |
2714
|
|
|
|
|
|
|
|
2715
|
|
|
|
|
|
|
/* The NeXT dynamic loader headers will not build with the bool macro |
2716
|
|
|
|
|
|
|
END |
2717
|
|
|
|
|
|
|
} |
2718
|
|
|
|
|
|
|
|
2719
|
|
|
|
|
|
|
sub _replace_makedepend { |
2720
|
|
|
|
|
|
|
# Replace makedepend with blead's version |
2721
|
0
|
|
|
0
|
|
|
_write_or_die('makedepend.SH', <<'END'); |
2722
|
|
|
|
|
|
|
#! /bin/sh |
2723
|
|
|
|
|
|
|
case $PERL_CONFIG_SH in |
2724
|
|
|
|
|
|
|
'') |
2725
|
|
|
|
|
|
|
if test -f config.sh; then TOP=.; |
2726
|
|
|
|
|
|
|
elif test -f ../config.sh; then TOP=..; |
2727
|
|
|
|
|
|
|
elif test -f ../../config.sh; then TOP=../..; |
2728
|
|
|
|
|
|
|
elif test -f ../../../config.sh; then TOP=../../..; |
2729
|
|
|
|
|
|
|
elif test -f ../../../../config.sh; then TOP=../../../..; |
2730
|
|
|
|
|
|
|
else |
2731
|
|
|
|
|
|
|
echo "Can't find config.sh."; exit 1 |
2732
|
|
|
|
|
|
|
fi |
2733
|
|
|
|
|
|
|
. $TOP/config.sh |
2734
|
|
|
|
|
|
|
;; |
2735
|
|
|
|
|
|
|
esac |
2736
|
|
|
|
|
|
|
: This forces SH files to create target in same directory as SH file. |
2737
|
|
|
|
|
|
|
: This is so that make depend always knows where to find SH derivatives. |
2738
|
|
|
|
|
|
|
case "$0" in |
2739
|
|
|
|
|
|
|
*/*) cd `expr X$0 : 'X\(.*\)/'` ;; |
2740
|
|
|
|
|
|
|
esac |
2741
|
|
|
|
|
|
|
|
2742
|
|
|
|
|
|
|
echo "Extracting makedepend (with variable substitutions)" |
2743
|
|
|
|
|
|
|
rm -f makedepend |
2744
|
|
|
|
|
|
|
$spitshell >makedepend <
|
2745
|
|
|
|
|
|
|
$startsh |
2746
|
|
|
|
|
|
|
# makedepend.SH |
2747
|
|
|
|
|
|
|
# |
2748
|
|
|
|
|
|
|
MAKE=$make |
2749
|
|
|
|
|
|
|
trnl='$trnl' |
2750
|
|
|
|
|
|
|
!GROK!THIS! |
2751
|
|
|
|
|
|
|
$spitshell >>makedepend <<'!NO!SUBS!' |
2752
|
|
|
|
|
|
|
|
2753
|
|
|
|
|
|
|
if test -d .depending; then |
2754
|
|
|
|
|
|
|
echo "$0: Already running, exiting." |
2755
|
|
|
|
|
|
|
exit 0 |
2756
|
|
|
|
|
|
|
fi |
2757
|
|
|
|
|
|
|
|
2758
|
|
|
|
|
|
|
mkdir .depending |
2759
|
|
|
|
|
|
|
|
2760
|
|
|
|
|
|
|
# This script should be called with |
2761
|
|
|
|
|
|
|
# sh ./makedepend MAKE=$(MAKE) |
2762
|
|
|
|
|
|
|
case "$1" in |
2763
|
|
|
|
|
|
|
MAKE=*) eval $1; shift ;; |
2764
|
|
|
|
|
|
|
esac |
2765
|
|
|
|
|
|
|
|
2766
|
|
|
|
|
|
|
export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh \$0; kill \$\$) |
2767
|
|
|
|
|
|
|
|
2768
|
|
|
|
|
|
|
case $PERL_CONFIG_SH in |
2769
|
|
|
|
|
|
|
'') |
2770
|
|
|
|
|
|
|
if test -f config.sh; then TOP=.; |
2771
|
|
|
|
|
|
|
elif test -f ../config.sh; then TOP=..; |
2772
|
|
|
|
|
|
|
elif test -f ../../config.sh; then TOP=../..; |
2773
|
|
|
|
|
|
|
elif test -f ../../../config.sh; then TOP=../../..; |
2774
|
|
|
|
|
|
|
elif test -f ../../../../config.sh; then TOP=../../../..; |
2775
|
|
|
|
|
|
|
else |
2776
|
|
|
|
|
|
|
echo "Can't find config.sh."; exit 1 |
2777
|
|
|
|
|
|
|
fi |
2778
|
|
|
|
|
|
|
. $TOP/config.sh |
2779
|
|
|
|
|
|
|
;; |
2780
|
|
|
|
|
|
|
esac |
2781
|
|
|
|
|
|
|
|
2782
|
|
|
|
|
|
|
# Avoid localized gcc messages |
2783
|
|
|
|
|
|
|
case "$ccname" in |
2784
|
|
|
|
|
|
|
gcc) LC_ALL=C ; export LC_ALL ;; |
2785
|
|
|
|
|
|
|
esac |
2786
|
|
|
|
|
|
|
|
2787
|
|
|
|
|
|
|
# We need .. when we are in the x2p directory if we are using the |
2788
|
|
|
|
|
|
|
# cppstdin wrapper script. |
2789
|
|
|
|
|
|
|
# Put .. and . first so that we pick up the present cppstdin, not |
2790
|
|
|
|
|
|
|
# an older one lying about in /usr/local/bin. |
2791
|
|
|
|
|
|
|
PATH=".$path_sep..$path_sep$PATH" |
2792
|
|
|
|
|
|
|
export PATH |
2793
|
|
|
|
|
|
|
|
2794
|
|
|
|
|
|
|
case "$osname" in |
2795
|
|
|
|
|
|
|
amigaos) cat=/bin/cat ;; # must be absolute |
2796
|
|
|
|
|
|
|
esac |
2797
|
|
|
|
|
|
|
|
2798
|
|
|
|
|
|
|
$cat /dev/null >.deptmp |
2799
|
|
|
|
|
|
|
$rm -f *.c.c c/*.c.c |
2800
|
|
|
|
|
|
|
if test -f Makefile; then |
2801
|
|
|
|
|
|
|
rm -f $firstmakefile |
2802
|
|
|
|
|
|
|
cp Makefile $firstmakefile |
2803
|
|
|
|
|
|
|
# On QNX, 'cp' preserves timestamp, so $firstmakefile appears |
2804
|
|
|
|
|
|
|
# to be out of date. I don't know if OS/2 has touch, so do this: |
2805
|
|
|
|
|
|
|
case "$osname" in |
2806
|
|
|
|
|
|
|
os2) ;; |
2807
|
|
|
|
|
|
|
*) $touch $firstmakefile ;; |
2808
|
|
|
|
|
|
|
esac |
2809
|
|
|
|
|
|
|
fi |
2810
|
|
|
|
|
|
|
mf=$firstmakefile |
2811
|
|
|
|
|
|
|
if test -f $mf; then |
2812
|
|
|
|
|
|
|
defrule=`<$mf sed -n \ |
2813
|
|
|
|
|
|
|
-e '/^\.c\$(OBJ_EXT):.*;/{' \ |
2814
|
|
|
|
|
|
|
-e 's/\$\*\.c//' \ |
2815
|
|
|
|
|
|
|
-e 's/^[^;]*;[ ]*//p' \ |
2816
|
|
|
|
|
|
|
-e q \ |
2817
|
|
|
|
|
|
|
-e '}' \ |
2818
|
|
|
|
|
|
|
-e '/^\.c\$(OBJ_EXT): *$/{' \ |
2819
|
|
|
|
|
|
|
-e N \ |
2820
|
|
|
|
|
|
|
-e 's/\$\*\.c//' \ |
2821
|
|
|
|
|
|
|
-e 's/^.*\n[ ]*//p' \ |
2822
|
|
|
|
|
|
|
-e q \ |
2823
|
|
|
|
|
|
|
-e '}'` |
2824
|
|
|
|
|
|
|
fi |
2825
|
|
|
|
|
|
|
case "$defrule" in |
2826
|
|
|
|
|
|
|
'') defrule='$(CC) -c $(CFLAGS)' ;; |
2827
|
|
|
|
|
|
|
esac |
2828
|
|
|
|
|
|
|
|
2829
|
|
|
|
|
|
|
: Create files in UU directory to avoid problems with long filenames |
2830
|
|
|
|
|
|
|
: on systems with 14 character filename limits so file.c.c and file.c |
2831
|
|
|
|
|
|
|
: might be identical |
2832
|
|
|
|
|
|
|
$test -d UU || mkdir UU |
2833
|
|
|
|
|
|
|
|
2834
|
|
|
|
|
|
|
$MAKE clist || ($echo "Searching for .c files..."; \ |
2835
|
|
|
|
|
|
|
$echo *.c | $tr ' ' $trnl | $egrep -v '\*' >.clist) |
2836
|
|
|
|
|
|
|
for file in `$cat .clist`; do |
2837
|
|
|
|
|
|
|
# for file in `cat /dev/null`; do |
2838
|
|
|
|
|
|
|
case "$osname" in |
2839
|
|
|
|
|
|
|
uwin) uwinfix="-e s,\\\\\\\\,/,g -e s,\\([a-zA-Z]\\):/,/\\1/,g" ;; |
2840
|
|
|
|
|
|
|
os2) uwinfix="-e s,\\\\\\\\,/,g" ;; |
2841
|
|
|
|
|
|
|
cygwin) uwinfix="-e s,\\\\\\\\,/,g" ;; |
2842
|
|
|
|
|
|
|
posix-bc) uwinfix="-e s/\\*POSIX(\\(.*\\))/\\1/" ;; |
2843
|
|
|
|
|
|
|
vos) uwinfix="-e s/\#/\\\#/" ;; |
2844
|
|
|
|
|
|
|
*) uwinfix="" ;; |
2845
|
|
|
|
|
|
|
esac |
2846
|
|
|
|
|
|
|
case "$file" in |
2847
|
|
|
|
|
|
|
*.c) filebase=`basename $file .c` ;; |
2848
|
|
|
|
|
|
|
*.y) filebase=`basename $file .y` ;; |
2849
|
|
|
|
|
|
|
esac |
2850
|
|
|
|
|
|
|
case "$file" in |
2851
|
|
|
|
|
|
|
*/*) finc="-I`echo $file | sed 's#/[^/]*$##'`" ;; |
2852
|
|
|
|
|
|
|
*) finc= ;; |
2853
|
|
|
|
|
|
|
esac |
2854
|
|
|
|
|
|
|
$echo "Finding dependencies for $filebase$_o." |
2855
|
|
|
|
|
|
|
# Below, we strip out all but preprocessor directives. |
2856
|
|
|
|
|
|
|
# We have to take care of situations like |
2857
|
|
|
|
|
|
|
# #if defined(FOO) BAR /* comment line 1 |
2858
|
|
|
|
|
|
|
# more comment lines */ |
2859
|
|
|
|
|
|
|
# If we just delete text starting from the '/*' to the end of line, we will |
2860
|
|
|
|
|
|
|
# screw up cases like |
2861
|
|
|
|
|
|
|
# #if defined(FOO) /* comment */ \ |
2862
|
|
|
|
|
|
|
# && defined(BAR) /* comment */ \ |
2863
|
|
|
|
|
|
|
# && defined(BAZ) /* comment */ \ |
2864
|
|
|
|
|
|
|
# etc. |
2865
|
|
|
|
|
|
|
# Also, in lines like |
2866
|
|
|
|
|
|
|
# #defined FOO(a,b) a/**/b |
2867
|
|
|
|
|
|
|
# the comment may be important and so needs to be retained. |
2868
|
|
|
|
|
|
|
# This code processes the single-line comments first; it assumes there is |
2869
|
|
|
|
|
|
|
# at most one straightforward comment per continued preprocessor line, |
2870
|
|
|
|
|
|
|
# replacing each non-empty comment (and its surrounding white space) by a |
2871
|
|
|
|
|
|
|
# single space. (sed only has a greedy '*' quantifier, so this doesn't |
2872
|
|
|
|
|
|
|
# work right if there are multiple comments per line, and strings can look |
2873
|
|
|
|
|
|
|
# like comments to it; both are unlikely in a preprocessor statement.) Any |
2874
|
|
|
|
|
|
|
# continuation line is joined, and the process repeated on the enlarged |
2875
|
|
|
|
|
|
|
# line as long as there are continuations. At the end, if there are any |
2876
|
|
|
|
|
|
|
# comments remaining, they are either completely empty or are like the |
2877
|
|
|
|
|
|
|
# first situation. The latter are just deleted by first deleting to the |
2878
|
|
|
|
|
|
|
# end of line (including preceding white space) things that start with '/*' |
2879
|
|
|
|
|
|
|
# and the next char isn't a '*'; then things that start with '/**', but the |
2880
|
|
|
|
|
|
|
# next char isn't a '/'. (Subsequent lines of the comment are irrelevant |
2881
|
|
|
|
|
|
|
# and get dropped.) At the end, we unjoin very long lines to avoid |
2882
|
|
|
|
|
|
|
# preprocessor limitations |
2883
|
|
|
|
|
|
|
( $echo "#line 2 \"$file\""; \ |
2884
|
|
|
|
|
|
|
$sed -n <$file \ |
2885
|
|
|
|
|
|
|
-e "/^${filebase}_init(/q" \ |
2886
|
|
|
|
|
|
|
-e ': testcont' \ |
2887
|
|
|
|
|
|
|
-e '/^[ ]*#/s|[ ]*/\*..*\*/[ ]*| |' \ |
2888
|
|
|
|
|
|
|
-e '/\\$/{' \ |
2889
|
|
|
|
|
|
|
-e 'N' \ |
2890
|
|
|
|
|
|
|
-e 'b testcont' \ |
2891
|
|
|
|
|
|
|
-e '}' \ |
2892
|
|
|
|
|
|
|
-e 's/\\\n//g' \ |
2893
|
|
|
|
|
|
|
-e '/^#line/d' \ |
2894
|
|
|
|
|
|
|
-e '/^[ ]*#/{' \ |
2895
|
|
|
|
|
|
|
-e 's|[ ]*/\*[^*].*$||' \ |
2896
|
|
|
|
|
|
|
-e 's|[ ]*/\*\*[^/].*$||' \ |
2897
|
|
|
|
|
|
|
-e 's/.\{255\}/&\\\n/g' \ |
2898
|
|
|
|
|
|
|
-e p \ |
2899
|
|
|
|
|
|
|
-e '}' ) >UU/$file.c |
2900
|
|
|
|
|
|
|
|
2901
|
|
|
|
|
|
|
# We're not sure why this was there; the #endif is extraneous on modern z/OS |
2902
|
|
|
|
|
|
|
#if [ "$osname" = os390 -a "$file" = perly.c ]; then |
2903
|
|
|
|
|
|
|
# $echo '#endif' >>UU/$file.c |
2904
|
|
|
|
|
|
|
#fi |
2905
|
|
|
|
|
|
|
|
2906
|
|
|
|
|
|
|
if [ "$osname" = os390 ]; then |
2907
|
|
|
|
|
|
|
$cppstdin $finc -I. $cppflags $cppminus
|
2908
|
|
|
|
|
|
|
$sed \ |
2909
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
2910
|
|
|
|
|
|
|
-e '/^#.*"-"/d' \ |
2911
|
|
|
|
|
|
|
-e '/^#.*git_version\.h/d' \ |
2912
|
|
|
|
|
|
|
-e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ |
2913
|
|
|
|
|
|
|
-e 's/^[ ]*#[ ]*line/#/' \ |
2914
|
|
|
|
|
|
|
-e '/^# *[0-9][0-9]* *[".\/]/!d' \ |
2915
|
|
|
|
|
|
|
-e 's/^.*"\(.*\)".*$/'$filebase'\$(OBJ_EXT): \1/' \ |
2916
|
|
|
|
|
|
|
-e 's/^# *[0-9][0-9]* \(.*\)$/'$filebase'\$(OBJ_EXT): \1/' \ |
2917
|
|
|
|
|
|
|
-e 's|: \./|: |' \ |
2918
|
|
|
|
|
|
|
-e 's|\.c\.c|.c|' $uwinfix | \ |
2919
|
|
|
|
|
|
|
$uniq | $sort | $uniq >> .deptmp |
2920
|
|
|
|
|
|
|
else |
2921
|
|
|
|
|
|
|
$cppstdin $finc -I. $cppflags $cppminus .cout 2>.cerr |
2922
|
|
|
|
|
|
|
$sed \ |
2923
|
|
|
|
|
|
|
-e '1d' \ |
2924
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
2925
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
2926
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
2927
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
2928
|
|
|
|
|
|
|
-e '/^#.*/d' \ |
2929
|
|
|
|
|
|
|
-e '/^#.*"-"/d' \ |
2930
|
|
|
|
|
|
|
-e '/^#.*"\/.*\/"/d' \ |
2931
|
|
|
|
|
|
|
-e '/: file path prefix .* never used$/d' \ |
2932
|
|
|
|
|
|
|
-e '/^#.*git_version\.h/d' \ |
2933
|
|
|
|
|
|
|
-e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ |
2934
|
|
|
|
|
|
|
-e 's/^[ ]*#[ ]*line/#/' \ |
2935
|
|
|
|
|
|
|
-e '/^# *[0-9][0-9]* *[".\/]/!d' \ |
2936
|
|
|
|
|
|
|
-e 's/^.*"\(.*\)".*$/'$filebase'\$(OBJ_EXT): \1/' \ |
2937
|
|
|
|
|
|
|
-e 's/^# *[0-9][0-9]* \(.*\)$/'$filebase'\$(OBJ_EXT): \1/' \ |
2938
|
|
|
|
|
|
|
-e 's|: \./|: |' \ |
2939
|
|
|
|
|
|
|
-e 's|\.c\.c|.c|' $uwinfix .cout .cerr| \ |
2940
|
|
|
|
|
|
|
$uniq | $sort | $uniq >> .deptmp |
2941
|
|
|
|
|
|
|
fi |
2942
|
|
|
|
|
|
|
echo "$filebase\$(OBJ_EXT): $@" >> .deptmp |
2943
|
|
|
|
|
|
|
done |
2944
|
|
|
|
|
|
|
|
2945
|
|
|
|
|
|
|
$sed <$mf >$mf.new -e '1,/^# AUTOMATICALLY/!d' |
2946
|
|
|
|
|
|
|
|
2947
|
|
|
|
|
|
|
if $test -s .deptmp; then |
2948
|
|
|
|
|
|
|
$echo "Updating $mf..." |
2949
|
|
|
|
|
|
|
$echo "# If this runs make out of memory, delete /usr/include lines." \ |
2950
|
|
|
|
|
|
|
>> $mf.new |
2951
|
|
|
|
|
|
|
if [ "$osname" = vos ]; then |
2952
|
|
|
|
|
|
|
$sed 's|\.incl\.c|.h|' .deptmp >.deptmp.vos |
2953
|
|
|
|
|
|
|
mv -f .deptmp.vos .deptmp |
2954
|
|
|
|
|
|
|
fi |
2955
|
|
|
|
|
|
|
$sed 's|^\(.*\$(OBJ_EXT):\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" .deptmp \ |
2956
|
|
|
|
|
|
|
>>$mf.new |
2957
|
|
|
|
|
|
|
else |
2958
|
|
|
|
|
|
|
$MAKE hlist || ($echo "Searching for .h files..."; \ |
2959
|
|
|
|
|
|
|
$echo *.h | $tr ' ' $trnl | $egrep -v '\*' >.hlist) |
2960
|
|
|
|
|
|
|
$echo "You don't seem to have a proper C preprocessor. Using grep instead." |
2961
|
|
|
|
|
|
|
$egrep '^#include ' `cat .clist` `cat .hlist` >.deptmp |
2962
|
|
|
|
|
|
|
$echo "Updating $mf..." |
2963
|
|
|
|
|
|
|
<.clist $sed -n \ |
2964
|
|
|
|
|
|
|
-e '/\//{' \ |
2965
|
|
|
|
|
|
|
-e 's|^\(.*\)/\(.*\)\.c|\2\$(OBJ_EXT): \1/\2.c; '"$defrule \1/\2.c|p" \ |
2966
|
|
|
|
|
|
|
-e d \ |
2967
|
|
|
|
|
|
|
-e '}' \ |
2968
|
|
|
|
|
|
|
-e 's|^\(.*\)\.c|\1\$(OBJ_EXT): \1.c|p' >> $mf.new |
2969
|
|
|
|
|
|
|
<.hlist $sed -n 's|\(.*/\)\(.*\)|s= \2= \1\2=|p' >.hsed |
2970
|
|
|
|
|
|
|
<.deptmp $sed -n 's|c:#include "\(.*\)".*$|o: \1|p' | \ |
2971
|
|
|
|
|
|
|
$sed 's|^[^;]*/||' | \ |
2972
|
|
|
|
|
|
|
$sed -f .hsed >> $mf.new |
2973
|
|
|
|
|
|
|
<.deptmp $sed -n 's|h:#include "\(.*\)".*$|h: \1|p' | \ |
2974
|
|
|
|
|
|
|
$sed -f .hsed >> $mf.new |
2975
|
|
|
|
|
|
|
fi |
2976
|
|
|
|
|
|
|
$rm -f $mf.old |
2977
|
|
|
|
|
|
|
$cp $mf $mf.old |
2978
|
|
|
|
|
|
|
$rm -f $mf |
2979
|
|
|
|
|
|
|
$cp $mf.new $mf |
2980
|
|
|
|
|
|
|
$rm $mf.new |
2981
|
|
|
|
|
|
|
$echo "# WARNING: Put nothing here or make depend will gobble it up!" >> $mf |
2982
|
|
|
|
|
|
|
$rm -rf .deptmp UU .clist .hlist .hsed .cout .cerr |
2983
|
|
|
|
|
|
|
rmdir .depending |
2984
|
|
|
|
|
|
|
|
2985
|
|
|
|
|
|
|
!NO!SUBS! |
2986
|
|
|
|
|
|
|
$eunicefix makedepend |
2987
|
|
|
|
|
|
|
chmod +x makedepend |
2988
|
|
|
|
|
|
|
END |
2989
|
|
|
|
|
|
|
} |
2990
|
|
|
|
|
|
|
|
2991
|
|
|
|
|
|
|
sub _patch_5_005_02 { |
2992
|
0
|
|
|
0
|
|
|
_patch(<<'END'); |
2993
|
|
|
|
|
|
|
--- Configure |
2994
|
|
|
|
|
|
|
+++ Configure |
2995
|
|
|
|
|
|
|
@@ -21,7 +21,7 @@ |
2996
|
|
|
|
|
|
|
# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ |
2997
|
|
|
|
|
|
|
# |
2998
|
|
|
|
|
|
|
# Generated on Tue Jul 7 10:10:21 EDT 1998 [metaconfig 3.0 PL70] |
2999
|
|
|
|
|
|
|
-# (with additional metaconfig patches by doughera@lafayette.edu) |
3000
|
|
|
|
|
|
|
+# (with additional metaconfig patches by jhi@iki.fi) |
3001
|
|
|
|
|
|
|
|
3002
|
|
|
|
|
|
|
cat >/tmp/c1$$ <
|
3003
|
|
|
|
|
|
|
ARGGGHHHH!!!!! |
3004
|
|
|
|
|
|
|
@@ -56,33 +56,6 @@ case "$0" in |
3005
|
|
|
|
|
|
|
;; |
3006
|
|
|
|
|
|
|
esac |
3007
|
|
|
|
|
|
|
|
3008
|
|
|
|
|
|
|
-: the newline for tr |
3009
|
|
|
|
|
|
|
-if test X"$trnl" = X; then |
3010
|
|
|
|
|
|
|
- case "`echo foo|tr '\n' x 2>/dev/null`" in |
3011
|
|
|
|
|
|
|
- foox) |
3012
|
|
|
|
|
|
|
- trnl='\n' |
3013
|
|
|
|
|
|
|
- ;; |
3014
|
|
|
|
|
|
|
- esac |
3015
|
|
|
|
|
|
|
-fi |
3016
|
|
|
|
|
|
|
-if test X"$trnl" = X; then |
3017
|
|
|
|
|
|
|
- case "`echo foo|tr '\012' x 2>/dev/null`" in |
3018
|
|
|
|
|
|
|
- foox) |
3019
|
|
|
|
|
|
|
- trnl='\012' |
3020
|
|
|
|
|
|
|
- ;; |
3021
|
|
|
|
|
|
|
- esac |
3022
|
|
|
|
|
|
|
-fi |
3023
|
|
|
|
|
|
|
-if test -n "$DJGPP"; then |
3024
|
|
|
|
|
|
|
- trnl='\012' |
3025
|
|
|
|
|
|
|
-fi |
3026
|
|
|
|
|
|
|
-if test X"$trnl" = X; then |
3027
|
|
|
|
|
|
|
- cat <&2 |
3028
|
|
|
|
|
|
|
- |
3029
|
|
|
|
|
|
|
-$me: Fatal Error: cannot figure out how to translate newlines with 'tr'. |
3030
|
|
|
|
|
|
|
- |
3031
|
|
|
|
|
|
|
-EOM |
3032
|
|
|
|
|
|
|
- exit 1 |
3033
|
|
|
|
|
|
|
-fi |
3034
|
|
|
|
|
|
|
- |
3035
|
|
|
|
|
|
|
: Proper separator for the PATH environment variable |
3036
|
|
|
|
|
|
|
p_=: |
3037
|
|
|
|
|
|
|
: On OS/2 this directory should exist if this is not floppy only system :-] |
3038
|
|
|
|
|
|
|
@@ -391,7 +364,6 @@ d_getservprotos='' |
3039
|
|
|
|
|
|
|
d_getsbyname='' |
3040
|
|
|
|
|
|
|
d_getsbyport='' |
3041
|
|
|
|
|
|
|
d_gnulibc='' |
3042
|
|
|
|
|
|
|
-i_arpainet='' |
3043
|
|
|
|
|
|
|
d_htonl='' |
3044
|
|
|
|
|
|
|
d_inetaton='' |
3045
|
|
|
|
|
|
|
d_isascii='' |
3046
|
|
|
|
|
|
|
@@ -540,6 +512,7 @@ dlsrc='' |
3047
|
|
|
|
|
|
|
ld='' |
3048
|
|
|
|
|
|
|
lddlflags='' |
3049
|
|
|
|
|
|
|
usedl='' |
3050
|
|
|
|
|
|
|
+ebcdic='' |
3051
|
|
|
|
|
|
|
doublesize='' |
3052
|
|
|
|
|
|
|
fpostype='' |
3053
|
|
|
|
|
|
|
gidtype='' |
3054
|
|
|
|
|
|
|
@@ -548,6 +521,7 @@ h_fcntl='' |
3055
|
|
|
|
|
|
|
h_sysfile='' |
3056
|
|
|
|
|
|
|
db_hashtype='' |
3057
|
|
|
|
|
|
|
db_prefixtype='' |
3058
|
|
|
|
|
|
|
+i_arpainet='' |
3059
|
|
|
|
|
|
|
i_db='' |
3060
|
|
|
|
|
|
|
i_dbm='' |
3061
|
|
|
|
|
|
|
i_rpcsvcdbm='' |
3062
|
|
|
|
|
|
|
@@ -633,6 +607,7 @@ libpth='' |
3063
|
|
|
|
|
|
|
loclibpth='' |
3064
|
|
|
|
|
|
|
plibpth='' |
3065
|
|
|
|
|
|
|
xlibpth='' |
3066
|
|
|
|
|
|
|
+ignore_versioned_solibs='' |
3067
|
|
|
|
|
|
|
libs='' |
3068
|
|
|
|
|
|
|
lns='' |
3069
|
|
|
|
|
|
|
lseektype='' |
3070
|
|
|
|
|
|
|
@@ -697,11 +672,13 @@ randbits='' |
3071
|
|
|
|
|
|
|
installscript='' |
3072
|
|
|
|
|
|
|
scriptdir='' |
3073
|
|
|
|
|
|
|
scriptdirexp='' |
3074
|
|
|
|
|
|
|
+selectminbits='' |
3075
|
|
|
|
|
|
|
selecttype='' |
3076
|
|
|
|
|
|
|
sh='' |
3077
|
|
|
|
|
|
|
sig_name='' |
3078
|
|
|
|
|
|
|
sig_name_init='' |
3079
|
|
|
|
|
|
|
sig_num='' |
3080
|
|
|
|
|
|
|
+sig_num_init='' |
3081
|
|
|
|
|
|
|
installsitearch='' |
3082
|
|
|
|
|
|
|
sitearch='' |
3083
|
|
|
|
|
|
|
sitearchexp='' |
3084
|
|
|
|
|
|
|
@@ -719,6 +696,7 @@ startperl='' |
3085
|
|
|
|
|
|
|
startsh='' |
3086
|
|
|
|
|
|
|
stdchar='' |
3087
|
|
|
|
|
|
|
sysman='' |
3088
|
|
|
|
|
|
|
+trnl='' |
3089
|
|
|
|
|
|
|
uidtype='' |
3090
|
|
|
|
|
|
|
nm_opt='' |
3091
|
|
|
|
|
|
|
nm_so_opt='' |
3092
|
|
|
|
|
|
|
@@ -733,7 +711,6 @@ mips_type='' |
3093
|
|
|
|
|
|
|
usrinc='' |
3094
|
|
|
|
|
|
|
defvoidused='' |
3095
|
|
|
|
|
|
|
voidflags='' |
3096
|
|
|
|
|
|
|
-ebcdic='' |
3097
|
|
|
|
|
|
|
CONFIG='' |
3098
|
|
|
|
|
|
|
|
3099
|
|
|
|
|
|
|
define='define' |
3100
|
|
|
|
|
|
|
@@ -836,6 +813,8 @@ plibpth='' |
3101
|
|
|
|
|
|
|
|
3102
|
|
|
|
|
|
|
: default library list |
3103
|
|
|
|
|
|
|
libswanted='' |
3104
|
|
|
|
|
|
|
+: some systems want only to use the non-versioned libso:s |
3105
|
|
|
|
|
|
|
+ignore_versioned_solibs='' |
3106
|
|
|
|
|
|
|
: Possible local include directories to search. |
3107
|
|
|
|
|
|
|
: Set locincpth to "" in a hint file to defeat local include searches. |
3108
|
|
|
|
|
|
|
locincpth="/usr/local/include /opt/local/include /usr/gnu/include" |
3109
|
|
|
|
|
|
|
@@ -904,7 +883,7 @@ case "$sh" in |
3110
|
|
|
|
|
|
|
$me: Fatal Error: I can't find a Bourne Shell anywhere. |
3111
|
|
|
|
|
|
|
|
3112
|
|
|
|
|
|
|
Usually it's in /bin/sh. How did you even get this far? |
3113
|
|
|
|
|
|
|
-Please contact me (Andy Dougherty) at doughera@lafayette.edu and |
3114
|
|
|
|
|
|
|
+Please contact me (Jarkko Hietaniemi) at jhi@iki.fi and |
3115
|
|
|
|
|
|
|
we'll try to straighten this all out. |
3116
|
|
|
|
|
|
|
EOM |
3117
|
|
|
|
|
|
|
exit 1 |
3118
|
|
|
|
|
|
|
@@ -1240,7 +1219,7 @@ cat >extract <<'EOS' |
3119
|
|
|
|
|
|
|
CONFIG=true |
3120
|
|
|
|
|
|
|
echo "Doing variable substitutions on .SH files..." |
3121
|
|
|
|
|
|
|
if test -f $src/MANIFEST; then |
3122
|
|
|
|
|
|
|
- set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH'` |
3123
|
|
|
|
|
|
|
+ set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'` |
3124
|
|
|
|
|
|
|
else |
3125
|
|
|
|
|
|
|
echo "(Looking for .SH files under the source directory.)" |
3126
|
|
|
|
|
|
|
set x `(cd $src; find . -name "*.SH" -print)` |
3127
|
|
|
|
|
|
|
@@ -1373,7 +1352,7 @@ THIS PACKAGE SEEMS TO BE INCOMPLETE. |
3128
|
|
|
|
|
|
|
You have the option of continuing the configuration process, despite the |
3129
|
|
|
|
|
|
|
distinct possibility that your kit is damaged, by typing 'y'es. If you |
3130
|
|
|
|
|
|
|
do, don't blame me if something goes wrong. I advise you to type 'n'o |
3131
|
|
|
|
|
|
|
-and contact the author (doughera@lafayette.edu). |
3132
|
|
|
|
|
|
|
+and contact the author (jhi@iki.fi). |
3133
|
|
|
|
|
|
|
|
3134
|
|
|
|
|
|
|
EOM |
3135
|
|
|
|
|
|
|
echo $n "Continue? [n] $c" >&4 |
3136
|
|
|
|
|
|
|
@@ -1396,6 +1375,30 @@ else |
3137
|
|
|
|
|
|
|
fi |
3138
|
|
|
|
|
|
|
rm -f missing x?? |
3139
|
|
|
|
|
|
|
|
3140
|
|
|
|
|
|
|
+echo " " |
3141
|
|
|
|
|
|
|
+: Find the appropriate value for a newline for tr |
3142
|
|
|
|
|
|
|
+if test -n "$DJGPP"; then |
3143
|
|
|
|
|
|
|
+ trnl='\012' |
3144
|
|
|
|
|
|
|
+fi |
3145
|
|
|
|
|
|
|
+if test X"$trnl" = X; then |
3146
|
|
|
|
|
|
|
+ case "`echo foo|tr '\n' x 2>/dev/null`" in |
3147
|
|
|
|
|
|
|
+ foox) trnl='\n' ;; |
3148
|
|
|
|
|
|
|
+ esac |
3149
|
|
|
|
|
|
|
+fi |
3150
|
|
|
|
|
|
|
+if test X"$trnl" = X; then |
3151
|
|
|
|
|
|
|
+ case "`echo foo|tr '\012' x 2>/dev/null`" in |
3152
|
|
|
|
|
|
|
+ foox) trnl='\012' ;; |
3153
|
|
|
|
|
|
|
+ esac |
3154
|
|
|
|
|
|
|
+fi |
3155
|
|
|
|
|
|
|
+if test X"$trnl" = X; then |
3156
|
|
|
|
|
|
|
+ cat <&2 |
3157
|
|
|
|
|
|
|
+ |
3158
|
|
|
|
|
|
|
+$me: Fatal Error: cannot figure out how to translate newlines with 'tr'. |
3159
|
|
|
|
|
|
|
+ |
3160
|
|
|
|
|
|
|
+EOM |
3161
|
|
|
|
|
|
|
+ exit 1 |
3162
|
|
|
|
|
|
|
+fi |
3163
|
|
|
|
|
|
|
+ |
3164
|
|
|
|
|
|
|
: compute the number of columns on the terminal for proper question formatting |
3165
|
|
|
|
|
|
|
case "$COLUMNS" in |
3166
|
|
|
|
|
|
|
'') COLUMNS='80';; |
3167
|
|
|
|
|
|
|
@@ -1574,7 +1577,7 @@ Much effort has been expended to ensure that this shell script will run on any |
3168
|
|
|
|
|
|
|
Unix system. If despite that it blows up on yours, your best bet is to edit |
3169
|
|
|
|
|
|
|
Configure and run it again. If you can't run Configure for some reason, |
3170
|
|
|
|
|
|
|
you'll have to generate a config.sh file by hand. Whatever problems you |
3171
|
|
|
|
|
|
|
-have, let me (doughera@lafayette.edu) know how I blew it. |
3172
|
|
|
|
|
|
|
+have, let me (jhi@iki.fi) know how I blew it. |
3173
|
|
|
|
|
|
|
|
3174
|
|
|
|
|
|
|
This installation script affects things in two ways: |
3175
|
|
|
|
|
|
|
|
3176
|
|
|
|
|
|
|
@@ -1841,14 +1844,14 @@ ABYZ) |
3177
|
|
|
|
|
|
|
*C9D1*|*c9d1*) |
3178
|
|
|
|
|
|
|
echo "Hey, this might be EBCDIC." >&4 |
3179
|
|
|
|
|
|
|
if test "X$up" = X -o "X$low" = X; then |
3180
|
|
|
|
|
|
|
- case "`echo IJ | tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in |
3181
|
|
|
|
|
|
|
+ case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in |
3182
|
|
|
|
|
|
|
ij) up='[A-IJ-RS-Z]' |
3183
|
|
|
|
|
|
|
low='[a-ij-rs-z]' |
3184
|
|
|
|
|
|
|
;; |
3185
|
|
|
|
|
|
|
esac |
3186
|
|
|
|
|
|
|
fi |
3187
|
|
|
|
|
|
|
if test "X$up" = X -o "X$low" = X; then |
3188
|
|
|
|
|
|
|
- case "`echo IJ | tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in |
3189
|
|
|
|
|
|
|
+ case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in |
3190
|
|
|
|
|
|
|
ij) up='A-IJ-RS-Z' |
3191
|
|
|
|
|
|
|
low='a-ij-rs-z' |
3192
|
|
|
|
|
|
|
;; |
3193
|
|
|
|
|
|
|
@@ -1941,7 +1944,7 @@ EOM |
3194
|
|
|
|
|
|
|
(cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4 |
3195
|
|
|
|
|
|
|
dflt='' |
3196
|
|
|
|
|
|
|
: Half the following guesses are probably wrong... If you have better |
3197
|
|
|
|
|
|
|
- : tests or hints, please send them to doughera@lafayette.edu |
3198
|
|
|
|
|
|
|
+ : tests or hints, please send them to jhi@iki.fi |
3199
|
|
|
|
|
|
|
: The metaconfig authors would also appreciate a copy... |
3200
|
|
|
|
|
|
|
$test -f /irix && osname=irix |
3201
|
|
|
|
|
|
|
$test -f /xenix && osname=sco_xenix |
3202
|
|
|
|
|
|
|
@@ -2025,7 +2028,7 @@ EOM |
3203
|
|
|
|
|
|
|
osvers="$3" |
3204
|
|
|
|
|
|
|
;; |
3205
|
|
|
|
|
|
|
dynixptx*) osname=dynixptx |
3206
|
|
|
|
|
|
|
- osvers="$3" |
3207
|
|
|
|
|
|
|
+ osvers=`echo "$4" | $sed 's/^v//'` |
3208
|
|
|
|
|
|
|
;; |
3209
|
|
|
|
|
|
|
freebsd) osname=freebsd |
3210
|
|
|
|
|
|
|
osvers="$3" ;; |
3211
|
|
|
|
|
|
|
@@ -3442,7 +3445,11 @@ cat <<'EOT' >testcpp.c |
3212
|
|
|
|
|
|
|
ABC.XYZ |
3213
|
|
|
|
|
|
|
EOT |
3214
|
|
|
|
|
|
|
cd .. |
3215
|
|
|
|
|
|
|
+if test ! -f cppstdin; then |
3216
|
|
|
|
|
|
|
echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin |
3217
|
|
|
|
|
|
|
+else |
3218
|
|
|
|
|
|
|
+ echo "Keeping your $hint cppstdin wrapper." |
3219
|
|
|
|
|
|
|
+fi |
3220
|
|
|
|
|
|
|
chmod 755 cppstdin |
3221
|
|
|
|
|
|
|
wrapper=`pwd`/cppstdin |
3222
|
|
|
|
|
|
|
ok='false' |
3223
|
|
|
|
|
|
|
@@ -3693,7 +3700,8 @@ case "$libswanted" in |
3224
|
|
|
|
|
|
|
esac |
3225
|
|
|
|
|
|
|
for thislib in $libswanted; do |
3226
|
|
|
|
|
|
|
|
3227
|
|
|
|
|
|
|
- if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then |
3228
|
|
|
|
|
|
|
+ if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; |
3229
|
|
|
|
|
|
|
+ $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then |
3230
|
|
|
|
|
|
|
echo "Found -l$thislib (shared)." |
3231
|
|
|
|
|
|
|
case " $dflt " in |
3232
|
|
|
|
|
|
|
*"-l$thislib "*);; |
3233
|
|
|
|
|
|
|
@@ -3980,10 +3988,21 @@ rmlist="$rmlist pdp11" |
3234
|
|
|
|
|
|
|
: coherency check |
3235
|
|
|
|
|
|
|
echo " " |
3236
|
|
|
|
|
|
|
echo "Checking your choice of C compiler and flags for coherency..." >&4 |
3237
|
|
|
|
|
|
|
+$cat > try.c <<'EOF' |
3238
|
|
|
|
|
|
|
+#include |
3239
|
|
|
|
|
|
|
+main() { printf("Ok\n"); exit(0); } |
3240
|
|
|
|
|
|
|
+EOF |
3241
|
|
|
|
|
|
|
set X $cc $optimize $ccflags -o try $ldflags try.c $libs |
3242
|
|
|
|
|
|
|
shift |
3243
|
|
|
|
|
|
|
-$cat >try.msg <
|
3244
|
|
|
|
|
|
|
-I've tried to compile and run a simple program with: |
3245
|
|
|
|
|
|
|
+$cat >try.msg <<'EOM' |
3246
|
|
|
|
|
|
|
+I've tried to compile and run the following simple program: |
3247
|
|
|
|
|
|
|
+ |
3248
|
|
|
|
|
|
|
+EOM |
3249
|
|
|
|
|
|
|
+$cat try.c |
3250
|
|
|
|
|
|
|
+ |
3251
|
|
|
|
|
|
|
+$cat >> try.msg <
|
3252
|
|
|
|
|
|
|
+ |
3253
|
|
|
|
|
|
|
+I used the command: |
3254
|
|
|
|
|
|
|
|
3255
|
|
|
|
|
|
|
$* |
3256
|
|
|
|
|
|
|
./try |
3257
|
|
|
|
|
|
|
@@ -3991,10 +4010,6 @@ I've tried to compile and run a simple program with: |
3258
|
|
|
|
|
|
|
and I got the following output: |
3259
|
|
|
|
|
|
|
|
3260
|
|
|
|
|
|
|
EOM |
3261
|
|
|
|
|
|
|
-$cat > try.c <<'EOF' |
3262
|
|
|
|
|
|
|
-#include |
3263
|
|
|
|
|
|
|
-main() { printf("Ok\n"); exit(0); } |
3264
|
|
|
|
|
|
|
-EOF |
3265
|
|
|
|
|
|
|
dflt=y |
3266
|
|
|
|
|
|
|
if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then |
3267
|
|
|
|
|
|
|
if sh -c './try' >>try.msg 2>&1; then |
3268
|
|
|
|
|
|
|
@@ -4031,7 +4046,7 @@ y) |
3269
|
|
|
|
|
|
|
$cat try.msg >&4 |
3270
|
|
|
|
|
|
|
case "$knowitall" in |
3271
|
|
|
|
|
|
|
'') |
3272
|
|
|
|
|
|
|
- echo "(The supplied flags might be incorrect with this C compiler.)" |
3273
|
|
|
|
|
|
|
+ echo "(The supplied flags or libraries might be incorrect.)" |
3274
|
|
|
|
|
|
|
;; |
3275
|
|
|
|
|
|
|
*) dflt=n;; |
3276
|
|
|
|
|
|
|
esac |
3277
|
|
|
|
|
|
|
@@ -4149,9 +4164,8 @@ eval $inhdr |
3278
|
|
|
|
|
|
|
: determine which malloc to compile in |
3279
|
|
|
|
|
|
|
echo " " |
3280
|
|
|
|
|
|
|
case "$usemymalloc" in |
3281
|
|
|
|
|
|
|
-''|y*|true) dflt='y' ;; |
3282
|
|
|
|
|
|
|
-n*|false) dflt='n' ;; |
3283
|
|
|
|
|
|
|
-*) dflt="$usemymalloc" ;; |
3284
|
|
|
|
|
|
|
+''|[yY]*|true|$define) dflt='y' ;; |
3285
|
|
|
|
|
|
|
+*) dflt='n' ;; |
3286
|
|
|
|
|
|
|
esac |
3287
|
|
|
|
|
|
|
rp="Do you wish to attempt to use the malloc that comes with $package?" |
3288
|
|
|
|
|
|
|
. ./myread |
3289
|
|
|
|
|
|
|
@@ -4253,7 +4267,7 @@ understands function prototypes. Unfortunately, your C compiler |
3290
|
|
|
|
|
|
|
$cc $ccflags |
3291
|
|
|
|
|
|
|
doesn't seem to understand them. Sorry about that. |
3292
|
|
|
|
|
|
|
|
3293
|
|
|
|
|
|
|
-If GNU cc is avaiable for your system, perhaps you could try that instead. |
3294
|
|
|
|
|
|
|
+If GNU cc is available for your system, perhaps you could try that instead. |
3295
|
|
|
|
|
|
|
|
3296
|
|
|
|
|
|
|
Eventually, we hope to support building Perl with pre-ANSI compilers. |
3297
|
|
|
|
|
|
|
If you would like to help in that effort, please contact . |
3298
|
|
|
|
|
|
|
@@ -4308,32 +4322,6 @@ shift; |
3299
|
|
|
|
|
|
|
$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;' |
3300
|
|
|
|
|
|
|
|
3301
|
|
|
|
|
|
|
echo " " |
3302
|
|
|
|
|
|
|
-echo "Determining whether or not we are on an EBCDIC system..." >&4 |
3303
|
|
|
|
|
|
|
-cat >tebcdic.c <
|
3304
|
|
|
|
|
|
|
-int main() |
3305
|
|
|
|
|
|
|
-{ |
3306
|
|
|
|
|
|
|
- if ('M'==0xd4) return 0; |
3307
|
|
|
|
|
|
|
- return 1; |
3308
|
|
|
|
|
|
|
-} |
3309
|
|
|
|
|
|
|
-EOM |
3310
|
|
|
|
|
|
|
-val=$undef |
3311
|
|
|
|
|
|
|
-set tebcdic |
3312
|
|
|
|
|
|
|
-if eval $compile_ok; then |
3313
|
|
|
|
|
|
|
- if ./tebcdic; then |
3314
|
|
|
|
|
|
|
- echo "You have EBCDIC." >&4 |
3315
|
|
|
|
|
|
|
- val="$define" |
3316
|
|
|
|
|
|
|
- else |
3317
|
|
|
|
|
|
|
- echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4 |
3318
|
|
|
|
|
|
|
- fi |
3319
|
|
|
|
|
|
|
-else |
3320
|
|
|
|
|
|
|
- echo "I'm unable to compile the test program." >&4 |
3321
|
|
|
|
|
|
|
- echo "I'll asuume ASCII or some ISO Latin." >&4 |
3322
|
|
|
|
|
|
|
-fi |
3323
|
|
|
|
|
|
|
-$rm -f tebcdic.c tebcdic |
3324
|
|
|
|
|
|
|
-set ebcdic |
3325
|
|
|
|
|
|
|
-eval $setvar |
3326
|
|
|
|
|
|
|
- |
3327
|
|
|
|
|
|
|
-echo " " |
3328
|
|
|
|
|
|
|
echo "Checking for GNU C Library..." >&4 |
3329
|
|
|
|
|
|
|
cat >gnulibc.c <
|
3330
|
|
|
|
|
|
|
#include |
3331
|
|
|
|
|
|
|
@@ -5147,7 +5135,7 @@ case "$shrpdir" in |
3332
|
|
|
|
|
|
|
*) $cat >&4 <
|
3333
|
|
|
|
|
|
|
WARNING: Use of the shrpdir variable for the installation location of |
3334
|
|
|
|
|
|
|
the shared $libperl is not supported. It was never documented and |
3335
|
|
|
|
|
|
|
-will not work in this version. Let me (doughera@lafayette.edu) |
3336
|
|
|
|
|
|
|
+will not work in this version. Let me (jhi@iki.fi) |
3337
|
|
|
|
|
|
|
know of any problems this may cause. |
3338
|
|
|
|
|
|
|
|
3339
|
|
|
|
|
|
|
EOM |
3340
|
|
|
|
|
|
|
@@ -6703,6 +6691,10 @@ eval $setvar |
3341
|
|
|
|
|
|
|
set difftime d_difftime |
3342
|
|
|
|
|
|
|
eval $inlibc |
3343
|
|
|
|
|
|
|
|
3344
|
|
|
|
|
|
|
+: see if sys/stat.h is available |
3345
|
|
|
|
|
|
|
+set sys/stat.h i_sysstat |
3346
|
|
|
|
|
|
|
+eval $inhdr |
3347
|
|
|
|
|
|
|
+ |
3348
|
|
|
|
|
|
|
: see if this is a dirent system |
3349
|
|
|
|
|
|
|
echo " " |
3350
|
|
|
|
|
|
|
if xinc=`./findhdr dirent.h`; $test "$xinc"; then |
3351
|
|
|
|
|
|
|
@@ -6771,6 +6763,23 @@ set d_dirnamlen |
3352
|
|
|
|
|
|
|
eval $setvar |
3353
|
|
|
|
|
|
|
$rm -f try.c |
3354
|
|
|
|
|
|
|
|
3355
|
|
|
|
|
|
|
+hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift; |
3356
|
|
|
|
|
|
|
+while $test $# -ge 2; do |
3357
|
|
|
|
|
|
|
+ case "$1" in |
3358
|
|
|
|
|
|
|
+ $define) echo "#include <$2>";; |
3359
|
|
|
|
|
|
|
+ esac ; |
3360
|
|
|
|
|
|
|
+ shift 2; |
3361
|
|
|
|
|
|
|
+done > try.c; |
3362
|
|
|
|
|
|
|
+echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c; |
3363
|
|
|
|
|
|
|
+if eval $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then |
3364
|
|
|
|
|
|
|
+ val="$define"; |
3365
|
|
|
|
|
|
|
+else |
3366
|
|
|
|
|
|
|
+ val="$undef"; |
3367
|
|
|
|
|
|
|
+fi; |
3368
|
|
|
|
|
|
|
+set $varname; |
3369
|
|
|
|
|
|
|
+eval $setvar; |
3370
|
|
|
|
|
|
|
+$rm -f try.c try.o' |
3371
|
|
|
|
|
|
|
+ |
3372
|
|
|
|
|
|
|
: see if dlerror exists |
3373
|
|
|
|
|
|
|
xxx_runnm="$runnm" |
3374
|
|
|
|
|
|
|
runnm=false |
3375
|
|
|
|
|
|
|
@@ -7305,7 +7314,7 @@ esac |
3376
|
|
|
|
|
|
|
set netinet/in.h i_niin sys/in.h i_sysin |
3377
|
|
|
|
|
|
|
eval $inhdr |
3378
|
|
|
|
|
|
|
|
3379
|
|
|
|
|
|
|
-: see if this is an arpa/inet.h |
3380
|
|
|
|
|
|
|
+: see if arpa/inet.h has to be included |
3381
|
|
|
|
|
|
|
set arpa/inet.h i_arpainet |
3382
|
|
|
|
|
|
|
eval $inhdr |
3383
|
|
|
|
|
|
|
|
3384
|
|
|
|
|
|
|
@@ -7635,7 +7644,7 @@ case "$osname" in |
3385
|
|
|
|
|
|
|
freebsd) |
3386
|
|
|
|
|
|
|
case "`ipcs 2>&1`" in |
3387
|
|
|
|
|
|
|
"SVID messages"*"not configured"*) |
3388
|
|
|
|
|
|
|
- echo "But your FreeBSD kernel does not have the msg*(2) configured." >&4 |
3389
|
|
|
|
|
|
|
+ echo "But your $osname does not have the msg*(2) configured." >&4 |
3390
|
|
|
|
|
|
|
h_msg=false |
3391
|
|
|
|
|
|
|
val="$undef" |
3392
|
|
|
|
|
|
|
set msgctl d_msgctl |
3393
|
|
|
|
|
|
|
@@ -7678,7 +7687,7 @@ set poll d_poll |
3394
|
|
|
|
|
|
|
eval $inlibc |
3395
|
|
|
|
|
|
|
|
3396
|
|
|
|
|
|
|
|
3397
|
|
|
|
|
|
|
-: see whether the various POSIXish _yields exist within given cccmd |
3398
|
|
|
|
|
|
|
+: see whether the various POSIXish _yields exist |
3399
|
|
|
|
|
|
|
$cat >try.c <
|
3400
|
|
|
|
|
|
|
#include |
3401
|
|
|
|
|
|
|
main() { |
3402
|
|
|
|
|
|
|
@@ -8136,7 +8145,7 @@ case "$osname" in |
3403
|
|
|
|
|
|
|
freebsd) |
3404
|
|
|
|
|
|
|
case "`ipcs 2>&1`" in |
3405
|
|
|
|
|
|
|
"SVID messages"*"not configured"*) |
3406
|
|
|
|
|
|
|
- echo "But your FreeBSD kernel does not have the sem*(2) configured." >&4 |
3407
|
|
|
|
|
|
|
+ echo "But your $osname does not have the sem*(2) configured." >&4 |
3408
|
|
|
|
|
|
|
h_sem=false |
3409
|
|
|
|
|
|
|
val="$undef" |
3410
|
|
|
|
|
|
|
set semctl d_semctl |
3411
|
|
|
|
|
|
|
@@ -8185,6 +8194,31 @@ case "$d_sem" in |
3412
|
|
|
|
|
|
|
$define) |
3413
|
|
|
|
|
|
|
: see whether semctl IPC_STAT can use union semun |
3414
|
|
|
|
|
|
|
echo " " |
3415
|
|
|
|
|
|
|
+ $cat > try.h <
|
3416
|
|
|
|
|
|
|
+#ifndef S_IRUSR |
3417
|
|
|
|
|
|
|
+# ifdef S_IREAD |
3418
|
|
|
|
|
|
|
+# define S_IRUSR S_IREAD |
3419
|
|
|
|
|
|
|
+# define S_IWUSR S_IWRITE |
3420
|
|
|
|
|
|
|
+# define S_IXUSR S_IEXEC |
3421
|
|
|
|
|
|
|
+# else |
3422
|
|
|
|
|
|
|
+# define S_IRUSR 0400 |
3423
|
|
|
|
|
|
|
+# define S_IWUSR 0200 |
3424
|
|
|
|
|
|
|
+# define S_IXUSR 0100 |
3425
|
|
|
|
|
|
|
+# endif |
3426
|
|
|
|
|
|
|
+# define S_IRGRP (S_IRUSR>>3) |
3427
|
|
|
|
|
|
|
+# define S_IWGRP (S_IWUSR>>3) |
3428
|
|
|
|
|
|
|
+# define S_IXGRP (S_IXUSR>>3) |
3429
|
|
|
|
|
|
|
+# define S_IROTH (S_IRUSR>>6) |
3430
|
|
|
|
|
|
|
+# define S_IWOTH (S_IWUSR>>6) |
3431
|
|
|
|
|
|
|
+# define S_IXOTH (S_IXUSR>>6) |
3432
|
|
|
|
|
|
|
+#endif |
3433
|
|
|
|
|
|
|
+#ifndef S_IRWXU |
3434
|
|
|
|
|
|
|
+# define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR) |
3435
|
|
|
|
|
|
|
+# define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP) |
3436
|
|
|
|
|
|
|
+# define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH) |
3437
|
|
|
|
|
|
|
+#endif |
3438
|
|
|
|
|
|
|
+END |
3439
|
|
|
|
|
|
|
+ |
3440
|
|
|
|
|
|
|
$cat > try.c <
|
3441
|
|
|
|
|
|
|
#include |
3442
|
|
|
|
|
|
|
#include |
3443
|
|
|
|
|
|
|
@@ -8259,6 +8293,7 @@ END |
3444
|
|
|
|
|
|
|
#include |
3445
|
|
|
|
|
|
|
#include |
3446
|
|
|
|
|
|
|
#include |
3447
|
|
|
|
|
|
|
+#include "try.h" |
3448
|
|
|
|
|
|
|
#ifndef errno |
3449
|
|
|
|
|
|
|
extern int errno; |
3450
|
|
|
|
|
|
|
#endif |
3451
|
|
|
|
|
|
|
@@ -8305,6 +8340,7 @@ END |
3452
|
|
|
|
|
|
|
*) echo "You cannot use struct semid_ds * for semctl IPC_STAT." >&4 |
3453
|
|
|
|
|
|
|
;; |
3454
|
|
|
|
|
|
|
esac |
3455
|
|
|
|
|
|
|
+ $rm -f try.h |
3456
|
|
|
|
|
|
|
;; |
3457
|
|
|
|
|
|
|
*) val="$undef" |
3458
|
|
|
|
|
|
|
|
3459
|
|
|
|
|
|
|
@@ -8499,7 +8535,7 @@ case "$osname" in |
3460
|
|
|
|
|
|
|
freebsd) |
3461
|
|
|
|
|
|
|
case "`ipcs 2>&1`" in |
3462
|
|
|
|
|
|
|
"SVID shared memory"*"not configured"*) |
3463
|
|
|
|
|
|
|
- echo "But your FreeBSD kernel does not have the shm*(2) configured." >&4 |
3464
|
|
|
|
|
|
|
+ echo "But your $osname does not have the shm*(2) configured." >&4 |
3465
|
|
|
|
|
|
|
h_shm=false |
3466
|
|
|
|
|
|
|
val="$undef" |
3467
|
|
|
|
|
|
|
set shmctl d_shmctl |
3468
|
|
|
|
|
|
|
@@ -8652,21 +8688,8 @@ eval $inlibc |
3469
|
|
|
|
|
|
|
|
3470
|
|
|
|
|
|
|
: see if stat knows about block sizes |
3471
|
|
|
|
|
|
|
echo " " |
3472
|
|
|
|
|
|
|
-xxx=`./findhdr sys/stat.h` |
3473
|
|
|
|
|
|
|
-if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then |
3474
|
|
|
|
|
|
|
- if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then |
3475
|
|
|
|
|
|
|
- echo "Your stat() knows about block sizes." >&4 |
3476
|
|
|
|
|
|
|
- val="$define" |
3477
|
|
|
|
|
|
|
- else |
3478
|
|
|
|
|
|
|
- echo "Your stat() doesn't know about block sizes." >&4 |
3479
|
|
|
|
|
|
|
- val="$undef" |
3480
|
|
|
|
|
|
|
- fi |
3481
|
|
|
|
|
|
|
-else |
3482
|
|
|
|
|
|
|
- echo "Your stat() doesn't know about block sizes." >&4 |
3483
|
|
|
|
|
|
|
- val="$undef" |
3484
|
|
|
|
|
|
|
-fi |
3485
|
|
|
|
|
|
|
-set d_statblks |
3486
|
|
|
|
|
|
|
-eval $setvar |
3487
|
|
|
|
|
|
|
+set d_statblks stat st_blocks $i_sysstat sys/stat.h |
3488
|
|
|
|
|
|
|
+eval $hasfield |
3489
|
|
|
|
|
|
|
|
3490
|
|
|
|
|
|
|
: see if _ptr and _cnt from stdio act std |
3491
|
|
|
|
|
|
|
echo " " |
3492
|
|
|
|
|
|
|
@@ -9610,6 +9633,32 @@ EOCP |
3493
|
|
|
|
|
|
|
esac |
3494
|
|
|
|
|
|
|
$rm -f try.c try |
3495
|
|
|
|
|
|
|
|
3496
|
|
|
|
|
|
|
+echo " " |
3497
|
|
|
|
|
|
|
+echo "Determining whether or not we are on an EBCDIC system..." >&4 |
3498
|
|
|
|
|
|
|
+$cat >tebcdic.c <
|
3499
|
|
|
|
|
|
|
+int main() |
3500
|
|
|
|
|
|
|
+{ |
3501
|
|
|
|
|
|
|
+ if ('M'==0xd4) return 0; |
3502
|
|
|
|
|
|
|
+ return 1; |
3503
|
|
|
|
|
|
|
+} |
3504
|
|
|
|
|
|
|
+EOM |
3505
|
|
|
|
|
|
|
+val=$undef |
3506
|
|
|
|
|
|
|
+set tebcdic |
3507
|
|
|
|
|
|
|
+if eval $compile_ok; then |
3508
|
|
|
|
|
|
|
+ if ./tebcdic; then |
3509
|
|
|
|
|
|
|
+ echo "You have EBCDIC." >&4 |
3510
|
|
|
|
|
|
|
+ val="$define" |
3511
|
|
|
|
|
|
|
+ else |
3512
|
|
|
|
|
|
|
+ echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4 |
3513
|
|
|
|
|
|
|
+ fi |
3514
|
|
|
|
|
|
|
+else |
3515
|
|
|
|
|
|
|
+ echo "I'm unable to compile the test program." >&4 |
3516
|
|
|
|
|
|
|
+ echo "I'll assume ASCII or some ISO Latin." >&4 |
3517
|
|
|
|
|
|
|
+fi |
3518
|
|
|
|
|
|
|
+$rm -f tebcdic.c tebcdic |
3519
|
|
|
|
|
|
|
+set ebcdic |
3520
|
|
|
|
|
|
|
+eval $setvar |
3521
|
|
|
|
|
|
|
+ |
3522
|
|
|
|
|
|
|
: see what type file positions are declared as in the library |
3523
|
|
|
|
|
|
|
rp="What is the type for file position used by fsetpos()?" |
3524
|
|
|
|
|
|
|
set fpos_t fpostype long stdio.h sys/types.h |
3525
|
|
|
|
|
|
|
@@ -10217,8 +10266,10 @@ EOM |
3526
|
|
|
|
|
|
|
: The first arg can be int, unsigned, or size_t |
3527
|
|
|
|
|
|
|
: The last arg may or may not be 'const' |
3528
|
|
|
|
|
|
|
val='' |
3529
|
|
|
|
|
|
|
+ : void pointer has been seen but using that |
3530
|
|
|
|
|
|
|
+ : breaks the selectminbits test |
3531
|
|
|
|
|
|
|
for xxx in 'fd_set *' 'int *'; do |
3532
|
|
|
|
|
|
|
- for nfd in 'int' 'size_t' 'unsigned' ; do |
3533
|
|
|
|
|
|
|
+ for nfd in 'int' 'size_t' 'unsigned' 'unsigned long'; do |
3534
|
|
|
|
|
|
|
for tmo in 'struct timeval *' 'const struct timeval *'; do |
3535
|
|
|
|
|
|
|
case "$val" in |
3536
|
|
|
|
|
|
|
'') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));" |
3537
|
|
|
|
|
|
|
@@ -10250,6 +10301,100 @@ EOM |
3538
|
|
|
|
|
|
|
;; |
3539
|
|
|
|
|
|
|
esac |
3540
|
|
|
|
|
|
|
|
3541
|
|
|
|
|
|
|
+: check for the select 'width' |
3542
|
|
|
|
|
|
|
+case "$selectminbits" in |
3543
|
|
|
|
|
|
|
+'') case "$d_select" in |
3544
|
|
|
|
|
|
|
+ $define) |
3545
|
|
|
|
|
|
|
+ $cat <
|
3546
|
|
|
|
|
|
|
+ |
3547
|
|
|
|
|
|
|
+Checking to see on how many bits at a time your select() operates... |
3548
|
|
|
|
|
|
|
+EOM |
3549
|
|
|
|
|
|
|
+ $cat >try.c <
|
3550
|
|
|
|
|
|
|
+#include |
3551
|
|
|
|
|
|
|
+#$i_time I_TIME |
3552
|
|
|
|
|
|
|
+#$i_systime I_SYS_TIME |
3553
|
|
|
|
|
|
|
+#$i_systimek I_SYS_TIME_KERNEL |
3554
|
|
|
|
|
|
|
+#ifdef I_TIME |
3555
|
|
|
|
|
|
|
+# include |
3556
|
|
|
|
|
|
|
+#endif |
3557
|
|
|
|
|
|
|
+#ifdef I_SYS_TIME |
3558
|
|
|
|
|
|
|
+# ifdef I_SYS_TIME_KERNEL |
3559
|
|
|
|
|
|
|
+# define KERNEL |
3560
|
|
|
|
|
|
|
+# endif |
3561
|
|
|
|
|
|
|
+# include |
3562
|
|
|
|
|
|
|
+# ifdef I_SYS_TIME_KERNEL |
3563
|
|
|
|
|
|
|
+# undef KERNEL |
3564
|
|
|
|
|
|
|
+# endif |
3565
|
|
|
|
|
|
|
+#endif |
3566
|
|
|
|
|
|
|
+#$i_sysselct I_SYS_SELECT |
3567
|
|
|
|
|
|
|
+#ifdef I_SYS_SELECT |
3568
|
|
|
|
|
|
|
+#include |
3569
|
|
|
|
|
|
|
+#endif |
3570
|
|
|
|
|
|
|
+#include |
3571
|
|
|
|
|
|
|
+$selecttype b; |
3572
|
|
|
|
|
|
|
+#define S sizeof(*(b)) |
3573
|
|
|
|
|
|
|
+#define MINBITS 64 |
3574
|
|
|
|
|
|
|
+#define NBYTES (S * 8 > MINBITS ? S : MINBITS/8) |
3575
|
|
|
|
|
|
|
+#define NBITS (NBYTES * 8) |
3576
|
|
|
|
|
|
|
+int main() { |
3577
|
|
|
|
|
|
|
+ char s[NBYTES]; |
3578
|
|
|
|
|
|
|
+ struct timeval t; |
3579
|
|
|
|
|
|
|
+ int i; |
3580
|
|
|
|
|
|
|
+ FILE* fp; |
3581
|
|
|
|
|
|
|
+ int fd; |
3582
|
|
|
|
|
|
|
+ |
3583
|
|
|
|
|
|
|
+ fclose(stdin); |
3584
|
|
|
|
|
|
|
+ fp = fopen("try.c", "r"); |
3585
|
|
|
|
|
|
|
+ if (fp == 0) |
3586
|
|
|
|
|
|
|
+ exit(1); |
3587
|
|
|
|
|
|
|
+ fd = fileno(fp); |
3588
|
|
|
|
|
|
|
+ if (fd < 0) |
3589
|
|
|
|
|
|
|
+ exit(2); |
3590
|
|
|
|
|
|
|
+ b = ($selecttype)s; |
3591
|
|
|
|
|
|
|
+ for (i = 0; i < NBITS; i++) |
3592
|
|
|
|
|
|
|
+ FD_SET(i, b); |
3593
|
|
|
|
|
|
|
+ t.tv_sec = 0; |
3594
|
|
|
|
|
|
|
+ t.tv_usec = 0; |
3595
|
|
|
|
|
|
|
+ select(fd + 1, b, 0, 0, &t); |
3596
|
|
|
|
|
|
|
+ for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--); |
3597
|
|
|
|
|
|
|
+ printf("%d\n", i + 1); |
3598
|
|
|
|
|
|
|
+ return 0; |
3599
|
|
|
|
|
|
|
+} |
3600
|
|
|
|
|
|
|
+EOCP |
3601
|
|
|
|
|
|
|
+ set try |
3602
|
|
|
|
|
|
|
+ if eval $compile_ok; then |
3603
|
|
|
|
|
|
|
+ selectminbits=`./try` |
3604
|
|
|
|
|
|
|
+ case "$selectminbits" in |
3605
|
|
|
|
|
|
|
+ '') cat >&4 <
|
3606
|
|
|
|
|
|
|
+Cannot figure out on how many bits at a time your select() operates. |
3607
|
|
|
|
|
|
|
+I'll play safe and guess it is 32 bits. |
3608
|
|
|
|
|
|
|
+EOM |
3609
|
|
|
|
|
|
|
+ selectminbits=32 |
3610
|
|
|
|
|
|
|
+ bits="32 bits" |
3611
|
|
|
|
|
|
|
+ ;; |
3612
|
|
|
|
|
|
|
+ 1) bits="1 bit" ;; |
3613
|
|
|
|
|
|
|
+ *) bits="$selectminbits bits" ;; |
3614
|
|
|
|
|
|
|
+ esac |
3615
|
|
|
|
|
|
|
+ echo "Your select() operates on $bits at a time." >&4 |
3616
|
|
|
|
|
|
|
+ else |
3617
|
|
|
|
|
|
|
+ rp='What is the minimum number of bits your select() operates on?' |
3618
|
|
|
|
|
|
|
+ case "$byteorder" in |
3619
|
|
|
|
|
|
|
+ 1234|12345678) dflt=32 ;; |
3620
|
|
|
|
|
|
|
+ *) dflt=1 ;; |
3621
|
|
|
|
|
|
|
+ esac |
3622
|
|
|
|
|
|
|
+ . ./myread |
3623
|
|
|
|
|
|
|
+ val=$ans |
3624
|
|
|
|
|
|
|
+ selectminbits="$val" |
3625
|
|
|
|
|
|
|
+ fi |
3626
|
|
|
|
|
|
|
+ $rm -f try.* try |
3627
|
|
|
|
|
|
|
+ ;; |
3628
|
|
|
|
|
|
|
+ *) : no select, so pick a harmless default |
3629
|
|
|
|
|
|
|
+ selectminbits='32' |
3630
|
|
|
|
|
|
|
+ ;; |
3631
|
|
|
|
|
|
|
+ esac |
3632
|
|
|
|
|
|
|
+ ;; |
3633
|
|
|
|
|
|
|
+esac |
3634
|
|
|
|
|
|
|
+ |
3635
|
|
|
|
|
|
|
: Trace out the files included by signal.h, then look for SIGxxx names. |
3636
|
|
|
|
|
|
|
: Remove SIGARRAYSIZE used by HPUX. |
3637
|
|
|
|
|
|
|
: Remove SIGTYP void lines used by OS2. |
3638
|
|
|
|
|
|
|
@@ -10458,7 +10603,13 @@ $eunicefix signal_cmd |
3639
|
|
|
|
|
|
|
: generate list of signal names |
3640
|
|
|
|
|
|
|
echo " " |
3641
|
|
|
|
|
|
|
case "$sig_name_init" in |
3642
|
|
|
|
|
|
|
-'') |
3643
|
|
|
|
|
|
|
+'') doinit=yes ;; |
3644
|
|
|
|
|
|
|
+*) case "$sig_num_init" in |
3645
|
|
|
|
|
|
|
+ ''|*,*) doinit=yes ;; |
3646
|
|
|
|
|
|
|
+ esac ;; |
3647
|
|
|
|
|
|
|
+esac |
3648
|
|
|
|
|
|
|
+case "$doinit" in |
3649
|
|
|
|
|
|
|
+yes) |
3650
|
|
|
|
|
|
|
echo "Generating a list of signal names and numbers..." >&4 |
3651
|
|
|
|
|
|
|
. ./signal_cmd |
3652
|
|
|
|
|
|
|
sig_name=`$awk '{printf "%s ", $1}' signal.lst` |
3653
|
|
|
|
|
|
|
@@ -10466,7 +10617,9 @@ case "$sig_name_init" in |
3654
|
|
|
|
|
|
|
sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " } |
3655
|
|
|
|
|
|
|
{ printf "\"%s\", ", $1 } |
3656
|
|
|
|
|
|
|
END { printf "0\n" }' signal.lst` |
3657
|
|
|
|
|
|
|
- sig_num=`$awk 'BEGIN { printf "0, " } |
3658
|
|
|
|
|
|
|
+ sig_num=`$awk '{printf "%d ", $2}' signal.lst` |
3659
|
|
|
|
|
|
|
+ sig_num="0 $sig_num" |
3660
|
|
|
|
|
|
|
+ sig_num_init=`$awk 'BEGIN { printf "0, " } |
3661
|
|
|
|
|
|
|
{ printf "%d, ", $2} |
3662
|
|
|
|
|
|
|
END { printf "0\n"}' signal.lst` |
3663
|
|
|
|
|
|
|
;; |
3664
|
|
|
|
|
|
|
@@ -10830,7 +10983,13 @@ $rm -f try.c |
3665
|
|
|
|
|
|
|
EOS |
3666
|
|
|
|
|
|
|
chmod +x ccsym |
3667
|
|
|
|
|
|
|
$eunicefix ccsym |
3668
|
|
|
|
|
|
|
-./ccsym | $sort | $uniq >ccsym.raw |
3669
|
|
|
|
|
|
|
+./ccsym > ccsym1.raw |
3670
|
|
|
|
|
|
|
+if $test -s ccsym1.raw; then |
3671
|
|
|
|
|
|
|
+ $sort ccsym1.raw | $uniq >ccsym.raw |
3672
|
|
|
|
|
|
|
+else |
3673
|
|
|
|
|
|
|
+ mv ccsym1.raw ccsym.raw |
3674
|
|
|
|
|
|
|
+fi |
3675
|
|
|
|
|
|
|
+ |
3676
|
|
|
|
|
|
|
$awk '/\=/ { print $0; next } |
3677
|
|
|
|
|
|
|
{ print $0"=1" }' ccsym.raw >ccsym.list |
3678
|
|
|
|
|
|
|
$awk '{ print $0"=1" }' Cppsym.true >ccsym.true |
3679
|
|
|
|
|
|
|
@@ -11055,10 +11214,6 @@ eval $inhdr |
3680
|
|
|
|
|
|
|
set sys/resource.h i_sysresrc |
3681
|
|
|
|
|
|
|
eval $inhdr |
3682
|
|
|
|
|
|
|
|
3683
|
|
|
|
|
|
|
-: see if sys/stat.h is available |
3684
|
|
|
|
|
|
|
-set sys/stat.h i_sysstat |
3685
|
|
|
|
|
|
|
-eval $inhdr |
3686
|
|
|
|
|
|
|
- |
3687
|
|
|
|
|
|
|
: see if this is a sys/un.h system |
3688
|
|
|
|
|
|
|
set sys/un.h i_sysun |
3689
|
|
|
|
|
|
|
eval $inhdr |
3690
|
|
|
|
|
|
|
@@ -11195,6 +11350,7 @@ for xxx in $known_extensions ; do |
3691
|
|
|
|
|
|
|
esac |
3692
|
|
|
|
|
|
|
;; |
3693
|
|
|
|
|
|
|
IPC/SysV|ipc/sysv) |
3694
|
|
|
|
|
|
|
+ : XXX Do we need a useipcsysv variable here |
3695
|
|
|
|
|
|
|
case "${d_msg}${d_sem}${d_shm}" in |
3696
|
|
|
|
|
|
|
*"${define}"*) avail_ext="$avail_ext $xxx" ;; |
3697
|
|
|
|
|
|
|
esac |
3698
|
|
|
|
|
|
|
@@ -11774,6 +11930,7 @@ i_values='$i_values' |
3699
|
|
|
|
|
|
|
i_varargs='$i_varargs' |
3700
|
|
|
|
|
|
|
i_varhdr='$i_varhdr' |
3701
|
|
|
|
|
|
|
i_vfork='$i_vfork' |
3702
|
|
|
|
|
|
|
+ignore_versioned_solibs='$ignore_versioned_solibs' |
3703
|
|
|
|
|
|
|
incpath='$incpath' |
3704
|
|
|
|
|
|
|
inews='$inews' |
3705
|
|
|
|
|
|
|
installarchlib='$installarchlib' |
3706
|
|
|
|
|
|
|
@@ -11882,6 +12039,7 @@ runnm='$runnm' |
3707
|
|
|
|
|
|
|
scriptdir='$scriptdir' |
3708
|
|
|
|
|
|
|
scriptdirexp='$scriptdirexp' |
3709
|
|
|
|
|
|
|
sed='$sed' |
3710
|
|
|
|
|
|
|
+selectminbits='$selectminbits' |
3711
|
|
|
|
|
|
|
selecttype='$selecttype' |
3712
|
|
|
|
|
|
|
sendmail='$sendmail' |
3713
|
|
|
|
|
|
|
sh='$sh' |
3714
|
|
|
|
|
|
|
@@ -11894,6 +12052,7 @@ shsharp='$shsharp' |
3715
|
|
|
|
|
|
|
sig_name='$sig_name' |
3716
|
|
|
|
|
|
|
sig_name_init='$sig_name_init' |
3717
|
|
|
|
|
|
|
sig_num='$sig_num' |
3718
|
|
|
|
|
|
|
+sig_num_init='$sig_num_init' |
3719
|
|
|
|
|
|
|
signal_t='$signal_t' |
3720
|
|
|
|
|
|
|
sitearch='$sitearch' |
3721
|
|
|
|
|
|
|
sitearchexp='$sitearchexp' |
3722
|
|
|
|
|
|
|
@@ -12023,51 +12182,6 @@ esac |
3723
|
|
|
|
|
|
|
: if this fails, just run all the .SH files by hand |
3724
|
|
|
|
|
|
|
. ./config.sh |
3725
|
|
|
|
|
|
|
|
3726
|
|
|
|
|
|
|
-case "$ebcdic" in |
3727
|
|
|
|
|
|
|
-$define) |
3728
|
|
|
|
|
|
|
- xxx='' |
3729
|
|
|
|
|
|
|
- echo "This is an EBCDIC system, checking if any parser files need regenerating." >&4 |
3730
|
|
|
|
|
|
|
- rm -f y.tab.c y.tab.h |
3731
|
|
|
|
|
|
|
- yacc -d perly.y >/dev/null 2>&1 |
3732
|
|
|
|
|
|
|
- if cmp -s y.tab.c perly.c; then |
3733
|
|
|
|
|
|
|
- rm -f y.tab.c |
3734
|
|
|
|
|
|
|
- else |
3735
|
|
|
|
|
|
|
- echo "perly.y -> perly.c" >&4 |
3736
|
|
|
|
|
|
|
- mv -f y.tab.c perly.c |
3737
|
|
|
|
|
|
|
- chmod u+w perly.c |
3738
|
|
|
|
|
|
|
- sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ |
3739
|
|
|
|
|
|
|
- -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c |
3740
|
|
|
|
|
|
|
- xxx="$xxx perly.c" |
3741
|
|
|
|
|
|
|
- fi |
3742
|
|
|
|
|
|
|
- if cmp -s y.tab.h perly.h; then |
3743
|
|
|
|
|
|
|
- rm -f y.tab.h |
3744
|
|
|
|
|
|
|
- else |
3745
|
|
|
|
|
|
|
- echo "perly.y -> perly.h" >&4 |
3746
|
|
|
|
|
|
|
- mv -f y.tab.h perly.h |
3747
|
|
|
|
|
|
|
- xxx="$xxx perly.h" |
3748
|
|
|
|
|
|
|
- fi |
3749
|
|
|
|
|
|
|
- echo "x2p/a2p.y" >&4 |
3750
|
|
|
|
|
|
|
- cd x2p |
3751
|
|
|
|
|
|
|
- rm -f y.tab.c |
3752
|
|
|
|
|
|
|
- yacc a2p.y >/dev/null 2>&1 |
3753
|
|
|
|
|
|
|
- if cmp -s y.tab.c a2p.c |
3754
|
|
|
|
|
|
|
- then |
3755
|
|
|
|
|
|
|
- rm -f y.tab.c |
3756
|
|
|
|
|
|
|
- else |
3757
|
|
|
|
|
|
|
- echo "a2p.y -> a2p.c" >&4 |
3758
|
|
|
|
|
|
|
- mv -f y.tab.c a2p.c |
3759
|
|
|
|
|
|
|
- chmod u+w a2p.c |
3760
|
|
|
|
|
|
|
- sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ |
3761
|
|
|
|
|
|
|
- -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c |
3762
|
|
|
|
|
|
|
- xxx="$xxx a2p.c" |
3763
|
|
|
|
|
|
|
- fi |
3764
|
|
|
|
|
|
|
- cd .. |
3765
|
|
|
|
|
|
|
- case "$xxx" in |
3766
|
|
|
|
|
|
|
- '') echo "No parser files were regenerated. That's okay." >&4 ;; |
3767
|
|
|
|
|
|
|
- esac |
3768
|
|
|
|
|
|
|
- ;; |
3769
|
|
|
|
|
|
|
-esac |
3770
|
|
|
|
|
|
|
- |
3771
|
|
|
|
|
|
|
echo " " |
3772
|
|
|
|
|
|
|
exec 1>&4 |
3773
|
|
|
|
|
|
|
. ./UU/extract |
3774
|
|
|
|
|
|
|
--- Makefile.SH |
3775
|
|
|
|
|
|
|
+++ Makefile.SH |
3776
|
|
|
|
|
|
|
@@ -644,3 +644,83 @@ case `pwd` in |
3777
|
|
|
|
|
|
|
;; |
3778
|
|
|
|
|
|
|
esac |
3779
|
|
|
|
|
|
|
$rm -f $firstmakefile |
3780
|
|
|
|
|
|
|
+ |
3781
|
|
|
|
|
|
|
+# Now do any special processing required before building. |
3782
|
|
|
|
|
|
|
+ |
3783
|
|
|
|
|
|
|
+case "$ebcdic" in |
3784
|
|
|
|
|
|
|
+$define) |
3785
|
|
|
|
|
|
|
+ xxx='' |
3786
|
|
|
|
|
|
|
+ echo "This is an EBCDIC system, checking if any parser files need regenerating." >&4 |
3787
|
|
|
|
|
|
|
+case "$osname" in |
3788
|
|
|
|
|
|
|
+os390) |
3789
|
|
|
|
|
|
|
+ rm -f y.tab.c y.tab.h |
3790
|
|
|
|
|
|
|
+ yacc -d perly.y >/dev/null 2>&1 |
3791
|
|
|
|
|
|
|
+ if cmp -s y.tab.c perly.c; then |
3792
|
|
|
|
|
|
|
+ rm -f y.tab.c |
3793
|
|
|
|
|
|
|
+ else |
3794
|
|
|
|
|
|
|
+ echo "perly.y -> perly.c" >&2 |
3795
|
|
|
|
|
|
|
+ mv -f y.tab.c perly.c |
3796
|
|
|
|
|
|
|
+ chmod u+w perly.c |
3797
|
|
|
|
|
|
|
+ sed -e '/^#include "perl\.h"/a\ |
3798
|
|
|
|
|
|
|
+\ |
3799
|
|
|
|
|
|
|
+#define yydebug PL_yydebug\ |
3800
|
|
|
|
|
|
|
+#define yynerrs PL_yynerrs\ |
3801
|
|
|
|
|
|
|
+#define yyerrflag PL_yyerrflag\ |
3802
|
|
|
|
|
|
|
+#define yychar PL_yychar\ |
3803
|
|
|
|
|
|
|
+#define yyval PL_yyval\ |
3804
|
|
|
|
|
|
|
+#define yylval PL_yylval' \ |
3805
|
|
|
|
|
|
|
+ -e '/YYSTYPE *yyval;/D' \ |
3806
|
|
|
|
|
|
|
+ -e '/YYSTYPE *yylval;/D' \ |
3807
|
|
|
|
|
|
|
+ -e '/int yychar,/,/yynerrs;/D' \ |
3808
|
|
|
|
|
|
|
+ -e 's/int yydebug = 0;/yydebug = 0;/' \ |
3809
|
|
|
|
|
|
|
+ -e 's/[^_]realloc(/PerlMem_realloc(/g' \ |
3810
|
|
|
|
|
|
|
+ -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ |
3811
|
|
|
|
|
|
|
+ -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c |
3812
|
|
|
|
|
|
|
+ xxx="$xxx perly.c" |
3813
|
|
|
|
|
|
|
+ fi |
3814
|
|
|
|
|
|
|
+ if cmp -s y.tab.h perly.h; then |
3815
|
|
|
|
|
|
|
+ rm -f y.tab.h |
3816
|
|
|
|
|
|
|
+ else |
3817
|
|
|
|
|
|
|
+ echo "perly.y -> perly.h" >&2 |
3818
|
|
|
|
|
|
|
+ mv -f y.tab.h perly.h |
3819
|
|
|
|
|
|
|
+ xxx="$xxx perly.h" |
3820
|
|
|
|
|
|
|
+ fi |
3821
|
|
|
|
|
|
|
+ if cd x2p |
3822
|
|
|
|
|
|
|
+ then |
3823
|
|
|
|
|
|
|
+ rm -f y.tab.c y.tab.h |
3824
|
|
|
|
|
|
|
+ yacc a2p.y >/dev/null 2>&1 |
3825
|
|
|
|
|
|
|
+ if cmp -s y.tab.c a2p.c |
3826
|
|
|
|
|
|
|
+ then |
3827
|
|
|
|
|
|
|
+ rm -f y.tab.c |
3828
|
|
|
|
|
|
|
+ else |
3829
|
|
|
|
|
|
|
+ echo "a2p.y -> a2p.c" >&2 |
3830
|
|
|
|
|
|
|
+ mv -f y.tab.c a2p.c |
3831
|
|
|
|
|
|
|
+ chmod u+w a2p.c |
3832
|
|
|
|
|
|
|
+ sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ |
3833
|
|
|
|
|
|
|
+ -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c |
3834
|
|
|
|
|
|
|
+ xxx="$xxx a2p.c" |
3835
|
|
|
|
|
|
|
+ fi |
3836
|
|
|
|
|
|
|
+ # In case somebody yacc -d:ed the a2p.y. |
3837
|
|
|
|
|
|
|
+ if test -f y.tab.h |
3838
|
|
|
|
|
|
|
+ then |
3839
|
|
|
|
|
|
|
+ if cmp -s y.tab.h a2p.h |
3840
|
|
|
|
|
|
|
+ then |
3841
|
|
|
|
|
|
|
+ rm -f y.tab.h |
3842
|
|
|
|
|
|
|
+ else |
3843
|
|
|
|
|
|
|
+ echo "a2p.h -> a2p.h" >&2 |
3844
|
|
|
|
|
|
|
+ mv -f y.tab.h a2p.h |
3845
|
|
|
|
|
|
|
+ xxx="$xxx a2p.h" |
3846
|
|
|
|
|
|
|
+ fi |
3847
|
|
|
|
|
|
|
+ fi |
3848
|
|
|
|
|
|
|
+ cd .. |
3849
|
|
|
|
|
|
|
+ fi |
3850
|
|
|
|
|
|
|
+ ;; |
3851
|
|
|
|
|
|
|
+*) |
3852
|
|
|
|
|
|
|
+ echo "'$osname' is an EBCDIC system I don't know that well." >&4 |
3853
|
|
|
|
|
|
|
+ ;; |
3854
|
|
|
|
|
|
|
+esac |
3855
|
|
|
|
|
|
|
+ case "$xxx" in |
3856
|
|
|
|
|
|
|
+ '') echo "No parser files were regenerated. That's okay." >&2 ;; |
3857
|
|
|
|
|
|
|
+ esac |
3858
|
|
|
|
|
|
|
+ ;; |
3859
|
|
|
|
|
|
|
+esac |
3860
|
|
|
|
|
|
|
--- config_h.SH |
3861
|
|
|
|
|
|
|
+++ config_h.SH |
3862
|
|
|
|
|
|
|
@@ -1813,7 +1813,7 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- |
3863
|
|
|
|
|
|
|
* the sig_name list. |
3864
|
|
|
|
|
|
|
*/ |
3865
|
|
|
|
|
|
|
#define SIG_NAME $sig_name_init /**/ |
3866
|
|
|
|
|
|
|
-#define SIG_NUM $sig_num /**/ |
3867
|
|
|
|
|
|
|
+#define SIG_NUM $sig_num_init /**/ |
3868
|
|
|
|
|
|
|
|
3869
|
|
|
|
|
|
|
/* VOIDFLAGS: |
3870
|
|
|
|
|
|
|
* This symbol indicates how much support of the void type is given by this |
3871
|
|
|
|
|
|
|
@@ -1902,6 +1902,15 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- |
3872
|
|
|
|
|
|
|
#define PRIVLIB "$privlib" /**/ |
3873
|
|
|
|
|
|
|
#define PRIVLIB_EXP "$privlibexp" /**/ |
3874
|
|
|
|
|
|
|
|
3875
|
|
|
|
|
|
|
+/* SELECT_MIN_BITS: |
3876
|
|
|
|
|
|
|
+ * This symbol holds the minimum number of bits operated by select. |
3877
|
|
|
|
|
|
|
+ * That is, if you do select(n, ...), how many bits at least will be |
3878
|
|
|
|
|
|
|
+ * cleared in the masks if some activity is detected. Usually this |
3879
|
|
|
|
|
|
|
+ * is either n or 32*ceil(n/32), especially many little-endians do |
3880
|
|
|
|
|
|
|
+ * the latter. This is only useful if you have select(), naturally. |
3881
|
|
|
|
|
|
|
+ */ |
3882
|
|
|
|
|
|
|
+#define SELECT_MIN_BITS $selectminbits /**/ |
3883
|
|
|
|
|
|
|
+ |
3884
|
|
|
|
|
|
|
/* SITEARCH: |
3885
|
|
|
|
|
|
|
* This symbol contains the name of the private library for this package. |
3886
|
|
|
|
|
|
|
* The library is private in the sense that it needn't be in anyone's |
3887
|
|
|
|
|
|
|
--- pp_sys.c |
3888
|
|
|
|
|
|
|
+++ pp_sys.c |
3889
|
|
|
|
|
|
|
@@ -56,7 +56,10 @@ extern "C" int syscall(unsigned long,...); |
3890
|
|
|
|
|
|
|
|
3891
|
|
|
|
|
|
|
/* XXX Configure test needed. |
3892
|
|
|
|
|
|
|
h_errno might not be a simple 'int', especially for multi-threaded |
3893
|
|
|
|
|
|
|
- applications. HOST_NOT_FOUND is typically defined in . |
3894
|
|
|
|
|
|
|
+ applications, see "extern int errno in perl.h". Creating such |
3895
|
|
|
|
|
|
|
+ a test requires taking into account the differences between |
3896
|
|
|
|
|
|
|
+ compiling multithreaded and singlethreaded ($ccflags et al). |
3897
|
|
|
|
|
|
|
+ HOST_NOT_FOUND is typically defined in . |
3898
|
|
|
|
|
|
|
*/ |
3899
|
|
|
|
|
|
|
#if defined(HOST_NOT_FOUND) && !defined(h_errno) |
3900
|
|
|
|
|
|
|
extern int h_errno; |
3901
|
|
|
|
|
|
|
@@ -753,12 +756,17 @@ PP(pp_sselect) |
3902
|
|
|
|
|
|
|
maxlen = j; |
3903
|
|
|
|
|
|
|
} |
3904
|
|
|
|
|
|
|
|
3905
|
|
|
|
|
|
|
+/* little endians can use vecs directly */ |
3906
|
|
|
|
|
|
|
#if BYTEORDER == 0x1234 || BYTEORDER == 0x12345678 |
3907
|
|
|
|
|
|
|
-/* XXX Configure test needed. */ |
3908
|
|
|
|
|
|
|
-#if defined(__linux__) || defined(OS2) || defined(NeXT) || defined(__osf__) || defined(sun) |
3909
|
|
|
|
|
|
|
- growsize = sizeof(fd_set); |
3910
|
|
|
|
|
|
|
+# if SELECT_MIN_BITS > 1 |
3911
|
|
|
|
|
|
|
+ /* If SELECT_MIN_BITS is greater than one we most probably will want |
3912
|
|
|
|
|
|
|
+ * to align the sizes with SELECT_MIN_BITS/8 because for example |
3913
|
|
|
|
|
|
|
+ * in many little-endian (Intel, Alpha) systems (Linux, OS/2, Digital |
3914
|
|
|
|
|
|
|
+ * UNIX, Solaris, NeXT) the smallest quantum select() operates on |
3915
|
|
|
|
|
|
|
+ * (sets bit) is 32 bits. */ |
3916
|
|
|
|
|
|
|
+ growsize = maxlen + (SELECT_MIN_BITS/8 - (maxlen % (SELECT_MIN_BITS/8))); |
3917
|
|
|
|
|
|
|
#else |
3918
|
|
|
|
|
|
|
- growsize = maxlen; /* little endians can use vecs directly */ |
3919
|
|
|
|
|
|
|
+ growsize = sizeof(fd_set); |
3920
|
|
|
|
|
|
|
#endif |
3921
|
|
|
|
|
|
|
#else |
3922
|
|
|
|
|
|
|
#ifdef NFDBITS |
3923
|
|
|
|
|
|
|
END |
3924
|
|
|
|
|
|
|
} |
3925
|
|
|
|
|
|
|
|
3926
|
|
|
|
|
|
|
sub _patch_5_005_01 { |
3927
|
0
|
|
|
0
|
|
|
_patch(<<'END'); |
3928
|
|
|
|
|
|
|
--- Configure |
3929
|
|
|
|
|
|
|
+++ Configure |
3930
|
|
|
|
|
|
|
@@ -21,7 +21,7 @@ |
3931
|
|
|
|
|
|
|
# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ |
3932
|
|
|
|
|
|
|
# |
3933
|
|
|
|
|
|
|
# Generated on Tue Jul 7 10:10:21 EDT 1998 [metaconfig 3.0 PL70] |
3934
|
|
|
|
|
|
|
-# (with additional metaconfig patches by doughera@lafayette.edu) |
3935
|
|
|
|
|
|
|
+# (with additional metaconfig patches by jhi@iki.fi) |
3936
|
|
|
|
|
|
|
|
3937
|
|
|
|
|
|
|
cat >/tmp/c1$$ <
|
3938
|
|
|
|
|
|
|
ARGGGHHHH!!!!! |
3939
|
|
|
|
|
|
|
@@ -56,33 +56,6 @@ case "$0" in |
3940
|
|
|
|
|
|
|
;; |
3941
|
|
|
|
|
|
|
esac |
3942
|
|
|
|
|
|
|
|
3943
|
|
|
|
|
|
|
-: the newline for tr |
3944
|
|
|
|
|
|
|
-if test X"$trnl" = X; then |
3945
|
|
|
|
|
|
|
- case "`echo foo|tr '\n' x 2>/dev/null`" in |
3946
|
|
|
|
|
|
|
- foox) |
3947
|
|
|
|
|
|
|
- trnl='\n' |
3948
|
|
|
|
|
|
|
- ;; |
3949
|
|
|
|
|
|
|
- esac |
3950
|
|
|
|
|
|
|
-fi |
3951
|
|
|
|
|
|
|
-if test X"$trnl" = X; then |
3952
|
|
|
|
|
|
|
- case "`echo foo|tr '\012' x 2>/dev/null`" in |
3953
|
|
|
|
|
|
|
- foox) |
3954
|
|
|
|
|
|
|
- trnl='\012' |
3955
|
|
|
|
|
|
|
- ;; |
3956
|
|
|
|
|
|
|
- esac |
3957
|
|
|
|
|
|
|
-fi |
3958
|
|
|
|
|
|
|
-if test -n "$DJGPP"; then |
3959
|
|
|
|
|
|
|
- trnl='\012' |
3960
|
|
|
|
|
|
|
-fi |
3961
|
|
|
|
|
|
|
-if test X"$trnl" = X; then |
3962
|
|
|
|
|
|
|
- cat <&2 |
3963
|
|
|
|
|
|
|
- |
3964
|
|
|
|
|
|
|
-$me: Fatal Error: cannot figure out how to translate newlines with 'tr'. |
3965
|
|
|
|
|
|
|
- |
3966
|
|
|
|
|
|
|
-EOM |
3967
|
|
|
|
|
|
|
- exit 1 |
3968
|
|
|
|
|
|
|
-fi |
3969
|
|
|
|
|
|
|
- |
3970
|
|
|
|
|
|
|
: Proper separator for the PATH environment variable |
3971
|
|
|
|
|
|
|
p_=: |
3972
|
|
|
|
|
|
|
: On OS/2 this directory should exist if this is not floppy only system :-] |
3973
|
|
|
|
|
|
|
@@ -391,7 +364,6 @@ d_getservprotos='' |
3974
|
|
|
|
|
|
|
d_getsbyname='' |
3975
|
|
|
|
|
|
|
d_getsbyport='' |
3976
|
|
|
|
|
|
|
d_gnulibc='' |
3977
|
|
|
|
|
|
|
-i_arpainet='' |
3978
|
|
|
|
|
|
|
d_htonl='' |
3979
|
|
|
|
|
|
|
d_inetaton='' |
3980
|
|
|
|
|
|
|
d_isascii='' |
3981
|
|
|
|
|
|
|
@@ -540,6 +512,7 @@ dlsrc='' |
3982
|
|
|
|
|
|
|
ld='' |
3983
|
|
|
|
|
|
|
lddlflags='' |
3984
|
|
|
|
|
|
|
usedl='' |
3985
|
|
|
|
|
|
|
+ebcdic='' |
3986
|
|
|
|
|
|
|
doublesize='' |
3987
|
|
|
|
|
|
|
fpostype='' |
3988
|
|
|
|
|
|
|
gidtype='' |
3989
|
|
|
|
|
|
|
@@ -548,6 +521,7 @@ h_fcntl='' |
3990
|
|
|
|
|
|
|
h_sysfile='' |
3991
|
|
|
|
|
|
|
db_hashtype='' |
3992
|
|
|
|
|
|
|
db_prefixtype='' |
3993
|
|
|
|
|
|
|
+i_arpainet='' |
3994
|
|
|
|
|
|
|
i_db='' |
3995
|
|
|
|
|
|
|
i_dbm='' |
3996
|
|
|
|
|
|
|
i_rpcsvcdbm='' |
3997
|
|
|
|
|
|
|
@@ -633,6 +607,7 @@ libpth='' |
3998
|
|
|
|
|
|
|
loclibpth='' |
3999
|
|
|
|
|
|
|
plibpth='' |
4000
|
|
|
|
|
|
|
xlibpth='' |
4001
|
|
|
|
|
|
|
+ignore_versioned_solibs='' |
4002
|
|
|
|
|
|
|
libs='' |
4003
|
|
|
|
|
|
|
lns='' |
4004
|
|
|
|
|
|
|
lseektype='' |
4005
|
|
|
|
|
|
|
@@ -697,11 +672,13 @@ randbits='' |
4006
|
|
|
|
|
|
|
installscript='' |
4007
|
|
|
|
|
|
|
scriptdir='' |
4008
|
|
|
|
|
|
|
scriptdirexp='' |
4009
|
|
|
|
|
|
|
+selectminbits='' |
4010
|
|
|
|
|
|
|
selecttype='' |
4011
|
|
|
|
|
|
|
sh='' |
4012
|
|
|
|
|
|
|
sig_name='' |
4013
|
|
|
|
|
|
|
sig_name_init='' |
4014
|
|
|
|
|
|
|
sig_num='' |
4015
|
|
|
|
|
|
|
+sig_num_init='' |
4016
|
|
|
|
|
|
|
installsitearch='' |
4017
|
|
|
|
|
|
|
sitearch='' |
4018
|
|
|
|
|
|
|
sitearchexp='' |
4019
|
|
|
|
|
|
|
@@ -719,6 +696,7 @@ startperl='' |
4020
|
|
|
|
|
|
|
startsh='' |
4021
|
|
|
|
|
|
|
stdchar='' |
4022
|
|
|
|
|
|
|
sysman='' |
4023
|
|
|
|
|
|
|
+trnl='' |
4024
|
|
|
|
|
|
|
uidtype='' |
4025
|
|
|
|
|
|
|
nm_opt='' |
4026
|
|
|
|
|
|
|
nm_so_opt='' |
4027
|
|
|
|
|
|
|
@@ -733,7 +711,6 @@ mips_type='' |
4028
|
|
|
|
|
|
|
usrinc='' |
4029
|
|
|
|
|
|
|
defvoidused='' |
4030
|
|
|
|
|
|
|
voidflags='' |
4031
|
|
|
|
|
|
|
-ebcdic='' |
4032
|
|
|
|
|
|
|
CONFIG='' |
4033
|
|
|
|
|
|
|
|
4034
|
|
|
|
|
|
|
define='define' |
4035
|
|
|
|
|
|
|
@@ -836,6 +813,8 @@ plibpth='' |
4036
|
|
|
|
|
|
|
|
4037
|
|
|
|
|
|
|
: default library list |
4038
|
|
|
|
|
|
|
libswanted='' |
4039
|
|
|
|
|
|
|
+: some systems want only to use the non-versioned libso:s |
4040
|
|
|
|
|
|
|
+ignore_versioned_solibs='' |
4041
|
|
|
|
|
|
|
: Possible local include directories to search. |
4042
|
|
|
|
|
|
|
: Set locincpth to "" in a hint file to defeat local include searches. |
4043
|
|
|
|
|
|
|
locincpth="/usr/local/include /opt/local/include /usr/gnu/include" |
4044
|
|
|
|
|
|
|
@@ -904,7 +883,7 @@ case "$sh" in |
4045
|
|
|
|
|
|
|
$me: Fatal Error: I can't find a Bourne Shell anywhere. |
4046
|
|
|
|
|
|
|
|
4047
|
|
|
|
|
|
|
Usually it's in /bin/sh. How did you even get this far? |
4048
|
|
|
|
|
|
|
-Please contact me (Andy Dougherty) at doughera@lafayette.edu and |
4049
|
|
|
|
|
|
|
+Please contact me (Jarkko Hietaniemi) at jhi@iki.fi and |
4050
|
|
|
|
|
|
|
we'll try to straighten this all out. |
4051
|
|
|
|
|
|
|
EOM |
4052
|
|
|
|
|
|
|
exit 1 |
4053
|
|
|
|
|
|
|
@@ -1240,7 +1219,7 @@ cat >extract <<'EOS' |
4054
|
|
|
|
|
|
|
CONFIG=true |
4055
|
|
|
|
|
|
|
echo "Doing variable substitutions on .SH files..." |
4056
|
|
|
|
|
|
|
if test -f $src/MANIFEST; then |
4057
|
|
|
|
|
|
|
- set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH'` |
4058
|
|
|
|
|
|
|
+ set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'` |
4059
|
|
|
|
|
|
|
else |
4060
|
|
|
|
|
|
|
echo "(Looking for .SH files under the source directory.)" |
4061
|
|
|
|
|
|
|
set x `(cd $src; find . -name "*.SH" -print)` |
4062
|
|
|
|
|
|
|
@@ -1373,7 +1352,7 @@ THIS PACKAGE SEEMS TO BE INCOMPLETE. |
4063
|
|
|
|
|
|
|
You have the option of continuing the configuration process, despite the |
4064
|
|
|
|
|
|
|
distinct possibility that your kit is damaged, by typing 'y'es. If you |
4065
|
|
|
|
|
|
|
do, don't blame me if something goes wrong. I advise you to type 'n'o |
4066
|
|
|
|
|
|
|
-and contact the author (doughera@lafayette.edu). |
4067
|
|
|
|
|
|
|
+and contact the author (jhi@iki.fi). |
4068
|
|
|
|
|
|
|
|
4069
|
|
|
|
|
|
|
EOM |
4070
|
|
|
|
|
|
|
echo $n "Continue? [n] $c" >&4 |
4071
|
|
|
|
|
|
|
@@ -1396,6 +1375,30 @@ else |
4072
|
|
|
|
|
|
|
fi |
4073
|
|
|
|
|
|
|
rm -f missing x?? |
4074
|
|
|
|
|
|
|
|
4075
|
|
|
|
|
|
|
+echo " " |
4076
|
|
|
|
|
|
|
+: Find the appropriate value for a newline for tr |
4077
|
|
|
|
|
|
|
+if test -n "$DJGPP"; then |
4078
|
|
|
|
|
|
|
+ trnl='\012' |
4079
|
|
|
|
|
|
|
+fi |
4080
|
|
|
|
|
|
|
+if test X"$trnl" = X; then |
4081
|
|
|
|
|
|
|
+ case "`echo foo|tr '\n' x 2>/dev/null`" in |
4082
|
|
|
|
|
|
|
+ foox) trnl='\n' ;; |
4083
|
|
|
|
|
|
|
+ esac |
4084
|
|
|
|
|
|
|
+fi |
4085
|
|
|
|
|
|
|
+if test X"$trnl" = X; then |
4086
|
|
|
|
|
|
|
+ case "`echo foo|tr '\012' x 2>/dev/null`" in |
4087
|
|
|
|
|
|
|
+ foox) trnl='\012' ;; |
4088
|
|
|
|
|
|
|
+ esac |
4089
|
|
|
|
|
|
|
+fi |
4090
|
|
|
|
|
|
|
+if test X"$trnl" = X; then |
4091
|
|
|
|
|
|
|
+ cat <&2 |
4092
|
|
|
|
|
|
|
+ |
4093
|
|
|
|
|
|
|
+$me: Fatal Error: cannot figure out how to translate newlines with 'tr'. |
4094
|
|
|
|
|
|
|
+ |
4095
|
|
|
|
|
|
|
+EOM |
4096
|
|
|
|
|
|
|
+ exit 1 |
4097
|
|
|
|
|
|
|
+fi |
4098
|
|
|
|
|
|
|
+ |
4099
|
|
|
|
|
|
|
: compute the number of columns on the terminal for proper question formatting |
4100
|
|
|
|
|
|
|
case "$COLUMNS" in |
4101
|
|
|
|
|
|
|
'') COLUMNS='80';; |
4102
|
|
|
|
|
|
|
@@ -1574,7 +1577,7 @@ Much effort has been expended to ensure that this shell script will run on any |
4103
|
|
|
|
|
|
|
Unix system. If despite that it blows up on yours, your best bet is to edit |
4104
|
|
|
|
|
|
|
Configure and run it again. If you can't run Configure for some reason, |
4105
|
|
|
|
|
|
|
you'll have to generate a config.sh file by hand. Whatever problems you |
4106
|
|
|
|
|
|
|
-have, let me (doughera@lafayette.edu) know how I blew it. |
4107
|
|
|
|
|
|
|
+have, let me (jhi@iki.fi) know how I blew it. |
4108
|
|
|
|
|
|
|
|
4109
|
|
|
|
|
|
|
This installation script affects things in two ways: |
4110
|
|
|
|
|
|
|
|
4111
|
|
|
|
|
|
|
@@ -1841,14 +1844,14 @@ ABYZ) |
4112
|
|
|
|
|
|
|
*C9D1*|*c9d1*) |
4113
|
|
|
|
|
|
|
echo "Hey, this might be EBCDIC." >&4 |
4114
|
|
|
|
|
|
|
if test "X$up" = X -o "X$low" = X; then |
4115
|
|
|
|
|
|
|
- case "`echo IJ | tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in |
4116
|
|
|
|
|
|
|
+ case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in |
4117
|
|
|
|
|
|
|
ij) up='[A-IJ-RS-Z]' |
4118
|
|
|
|
|
|
|
low='[a-ij-rs-z]' |
4119
|
|
|
|
|
|
|
;; |
4120
|
|
|
|
|
|
|
esac |
4121
|
|
|
|
|
|
|
fi |
4122
|
|
|
|
|
|
|
if test "X$up" = X -o "X$low" = X; then |
4123
|
|
|
|
|
|
|
- case "`echo IJ | tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in |
4124
|
|
|
|
|
|
|
+ case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in |
4125
|
|
|
|
|
|
|
ij) up='A-IJ-RS-Z' |
4126
|
|
|
|
|
|
|
low='a-ij-rs-z' |
4127
|
|
|
|
|
|
|
;; |
4128
|
|
|
|
|
|
|
@@ -1941,7 +1944,7 @@ EOM |
4129
|
|
|
|
|
|
|
(cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4 |
4130
|
|
|
|
|
|
|
dflt='' |
4131
|
|
|
|
|
|
|
: Half the following guesses are probably wrong... If you have better |
4132
|
|
|
|
|
|
|
- : tests or hints, please send them to doughera@lafayette.edu |
4133
|
|
|
|
|
|
|
+ : tests or hints, please send them to jhi@iki.fi |
4134
|
|
|
|
|
|
|
: The metaconfig authors would also appreciate a copy... |
4135
|
|
|
|
|
|
|
$test -f /irix && osname=irix |
4136
|
|
|
|
|
|
|
$test -f /xenix && osname=sco_xenix |
4137
|
|
|
|
|
|
|
@@ -2025,7 +2028,7 @@ EOM |
4138
|
|
|
|
|
|
|
osvers="$3" |
4139
|
|
|
|
|
|
|
;; |
4140
|
|
|
|
|
|
|
dynixptx*) osname=dynixptx |
4141
|
|
|
|
|
|
|
- osvers="$3" |
4142
|
|
|
|
|
|
|
+ osvers=`echo "$4" | $sed 's/^v//'` |
4143
|
|
|
|
|
|
|
;; |
4144
|
|
|
|
|
|
|
freebsd) osname=freebsd |
4145
|
|
|
|
|
|
|
osvers="$3" ;; |
4146
|
|
|
|
|
|
|
@@ -3454,7 +3457,11 @@ cat <<'EOT' >testcpp.c |
4147
|
|
|
|
|
|
|
ABC.XYZ |
4148
|
|
|
|
|
|
|
EOT |
4149
|
|
|
|
|
|
|
cd .. |
4150
|
|
|
|
|
|
|
+if test ! -f cppstdin; then |
4151
|
|
|
|
|
|
|
echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin |
4152
|
|
|
|
|
|
|
+else |
4153
|
|
|
|
|
|
|
+ echo "Keeping your $hint cppstdin wrapper." |
4154
|
|
|
|
|
|
|
+fi |
4155
|
|
|
|
|
|
|
chmod 755 cppstdin |
4156
|
|
|
|
|
|
|
wrapper=`pwd`/cppstdin |
4157
|
|
|
|
|
|
|
ok='false' |
4158
|
|
|
|
|
|
|
@@ -3705,7 +3712,8 @@ case "$libswanted" in |
4159
|
|
|
|
|
|
|
esac |
4160
|
|
|
|
|
|
|
for thislib in $libswanted; do |
4161
|
|
|
|
|
|
|
|
4162
|
|
|
|
|
|
|
- if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then |
4163
|
|
|
|
|
|
|
+ if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; |
4164
|
|
|
|
|
|
|
+ $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then |
4165
|
|
|
|
|
|
|
echo "Found -l$thislib (shared)." |
4166
|
|
|
|
|
|
|
case " $dflt " in |
4167
|
|
|
|
|
|
|
*"-l$thislib "*);; |
4168
|
|
|
|
|
|
|
@@ -3992,10 +4000,21 @@ rmlist="$rmlist pdp11" |
4169
|
|
|
|
|
|
|
: coherency check |
4170
|
|
|
|
|
|
|
echo " " |
4171
|
|
|
|
|
|
|
echo "Checking your choice of C compiler and flags for coherency..." >&4 |
4172
|
|
|
|
|
|
|
+$cat > try.c <<'EOF' |
4173
|
|
|
|
|
|
|
+#include |
4174
|
|
|
|
|
|
|
+main() { printf("Ok\n"); exit(0); } |
4175
|
|
|
|
|
|
|
+EOF |
4176
|
|
|
|
|
|
|
set X $cc $optimize $ccflags -o try $ldflags try.c $libs |
4177
|
|
|
|
|
|
|
shift |
4178
|
|
|
|
|
|
|
-$cat >try.msg <
|
4179
|
|
|
|
|
|
|
-I've tried to compile and run a simple program with: |
4180
|
|
|
|
|
|
|
+$cat >try.msg <<'EOM' |
4181
|
|
|
|
|
|
|
+I've tried to compile and run the following simple program: |
4182
|
|
|
|
|
|
|
+ |
4183
|
|
|
|
|
|
|
+EOM |
4184
|
|
|
|
|
|
|
+$cat try.c |
4185
|
|
|
|
|
|
|
+ |
4186
|
|
|
|
|
|
|
+$cat >> try.msg <
|
4187
|
|
|
|
|
|
|
+ |
4188
|
|
|
|
|
|
|
+I used the command: |
4189
|
|
|
|
|
|
|
|
4190
|
|
|
|
|
|
|
$* |
4191
|
|
|
|
|
|
|
./try |
4192
|
|
|
|
|
|
|
@@ -4003,10 +4022,6 @@ I've tried to compile and run a simple program with: |
4193
|
|
|
|
|
|
|
and I got the following output: |
4194
|
|
|
|
|
|
|
|
4195
|
|
|
|
|
|
|
EOM |
4196
|
|
|
|
|
|
|
-$cat > try.c <<'EOF' |
4197
|
|
|
|
|
|
|
-#include |
4198
|
|
|
|
|
|
|
-main() { printf("Ok\n"); exit(0); } |
4199
|
|
|
|
|
|
|
-EOF |
4200
|
|
|
|
|
|
|
dflt=y |
4201
|
|
|
|
|
|
|
if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then |
4202
|
|
|
|
|
|
|
if sh -c './try' >>try.msg 2>&1; then |
4203
|
|
|
|
|
|
|
@@ -4043,7 +4058,7 @@ y) |
4204
|
|
|
|
|
|
|
$cat try.msg >&4 |
4205
|
|
|
|
|
|
|
case "$knowitall" in |
4206
|
|
|
|
|
|
|
'') |
4207
|
|
|
|
|
|
|
- echo "(The supplied flags might be incorrect with this C compiler.)" |
4208
|
|
|
|
|
|
|
+ echo "(The supplied flags or libraries might be incorrect.)" |
4209
|
|
|
|
|
|
|
;; |
4210
|
|
|
|
|
|
|
*) dflt=n;; |
4211
|
|
|
|
|
|
|
esac |
4212
|
|
|
|
|
|
|
@@ -4161,9 +4176,8 @@ eval $inhdr |
4213
|
|
|
|
|
|
|
: determine which malloc to compile in |
4214
|
|
|
|
|
|
|
echo " " |
4215
|
|
|
|
|
|
|
case "$usemymalloc" in |
4216
|
|
|
|
|
|
|
-''|y*|true) dflt='y' ;; |
4217
|
|
|
|
|
|
|
-n*|false) dflt='n' ;; |
4218
|
|
|
|
|
|
|
-*) dflt="$usemymalloc" ;; |
4219
|
|
|
|
|
|
|
+''|[yY]*|true|$define) dflt='y' ;; |
4220
|
|
|
|
|
|
|
+*) dflt='n' ;; |
4221
|
|
|
|
|
|
|
esac |
4222
|
|
|
|
|
|
|
rp="Do you wish to attempt to use the malloc that comes with $package?" |
4223
|
|
|
|
|
|
|
. ./myread |
4224
|
|
|
|
|
|
|
@@ -4265,7 +4279,7 @@ understands function prototypes. Unfortunately, your C compiler |
4225
|
|
|
|
|
|
|
$cc $ccflags |
4226
|
|
|
|
|
|
|
doesn't seem to understand them. Sorry about that. |
4227
|
|
|
|
|
|
|
|
4228
|
|
|
|
|
|
|
-If GNU cc is avaiable for your system, perhaps you could try that instead. |
4229
|
|
|
|
|
|
|
+If GNU cc is available for your system, perhaps you could try that instead. |
4230
|
|
|
|
|
|
|
|
4231
|
|
|
|
|
|
|
Eventually, we hope to support building Perl with pre-ANSI compilers. |
4232
|
|
|
|
|
|
|
If you would like to help in that effort, please contact . |
4233
|
|
|
|
|
|
|
@@ -4320,32 +4334,6 @@ shift; |
4234
|
|
|
|
|
|
|
$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;' |
4235
|
|
|
|
|
|
|
|
4236
|
|
|
|
|
|
|
echo " " |
4237
|
|
|
|
|
|
|
-echo "Determining whether or not we are on an EBCDIC system..." >&4 |
4238
|
|
|
|
|
|
|
-cat >tebcdic.c <
|
4239
|
|
|
|
|
|
|
-int main() |
4240
|
|
|
|
|
|
|
-{ |
4241
|
|
|
|
|
|
|
- if ('M'==0xd4) return 0; |
4242
|
|
|
|
|
|
|
- return 1; |
4243
|
|
|
|
|
|
|
-} |
4244
|
|
|
|
|
|
|
-EOM |
4245
|
|
|
|
|
|
|
-val=$undef |
4246
|
|
|
|
|
|
|
-set tebcdic |
4247
|
|
|
|
|
|
|
-if eval $compile_ok; then |
4248
|
|
|
|
|
|
|
- if ./tebcdic; then |
4249
|
|
|
|
|
|
|
- echo "You have EBCDIC." >&4 |
4250
|
|
|
|
|
|
|
- val="$define" |
4251
|
|
|
|
|
|
|
- else |
4252
|
|
|
|
|
|
|
- echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4 |
4253
|
|
|
|
|
|
|
- fi |
4254
|
|
|
|
|
|
|
-else |
4255
|
|
|
|
|
|
|
- echo "I'm unable to compile the test program." >&4 |
4256
|
|
|
|
|
|
|
- echo "I'll asuume ASCII or some ISO Latin." >&4 |
4257
|
|
|
|
|
|
|
-fi |
4258
|
|
|
|
|
|
|
-$rm -f tebcdic.c tebcdic |
4259
|
|
|
|
|
|
|
-set ebcdic |
4260
|
|
|
|
|
|
|
-eval $setvar |
4261
|
|
|
|
|
|
|
- |
4262
|
|
|
|
|
|
|
-echo " " |
4263
|
|
|
|
|
|
|
echo "Checking for GNU C Library..." >&4 |
4264
|
|
|
|
|
|
|
cat >gnulibc.c <
|
4265
|
|
|
|
|
|
|
#include |
4266
|
|
|
|
|
|
|
@@ -5159,7 +5147,7 @@ case "$shrpdir" in |
4267
|
|
|
|
|
|
|
*) $cat >&4 <
|
4268
|
|
|
|
|
|
|
WARNING: Use of the shrpdir variable for the installation location of |
4269
|
|
|
|
|
|
|
the shared $libperl is not supported. It was never documented and |
4270
|
|
|
|
|
|
|
-will not work in this version. Let me (doughera@lafayette.edu) |
4271
|
|
|
|
|
|
|
+will not work in this version. Let me (jhi@iki.fi) |
4272
|
|
|
|
|
|
|
know of any problems this may cause. |
4273
|
|
|
|
|
|
|
|
4274
|
|
|
|
|
|
|
EOM |
4275
|
|
|
|
|
|
|
@@ -6715,6 +6703,10 @@ eval $setvar |
4276
|
|
|
|
|
|
|
set difftime d_difftime |
4277
|
|
|
|
|
|
|
eval $inlibc |
4278
|
|
|
|
|
|
|
|
4279
|
|
|
|
|
|
|
+: see if sys/stat.h is available |
4280
|
|
|
|
|
|
|
+set sys/stat.h i_sysstat |
4281
|
|
|
|
|
|
|
+eval $inhdr |
4282
|
|
|
|
|
|
|
+ |
4283
|
|
|
|
|
|
|
: see if this is a dirent system |
4284
|
|
|
|
|
|
|
echo " " |
4285
|
|
|
|
|
|
|
if xinc=`./findhdr dirent.h`; $test "$xinc"; then |
4286
|
|
|
|
|
|
|
@@ -6783,6 +6775,23 @@ set d_dirnamlen |
4287
|
|
|
|
|
|
|
eval $setvar |
4288
|
|
|
|
|
|
|
$rm -f try.c |
4289
|
|
|
|
|
|
|
|
4290
|
|
|
|
|
|
|
+hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift; |
4291
|
|
|
|
|
|
|
+while $test $# -ge 2; do |
4292
|
|
|
|
|
|
|
+ case "$1" in |
4293
|
|
|
|
|
|
|
+ $define) echo "#include <$2>";; |
4294
|
|
|
|
|
|
|
+ esac ; |
4295
|
|
|
|
|
|
|
+ shift 2; |
4296
|
|
|
|
|
|
|
+done > try.c; |
4297
|
|
|
|
|
|
|
+echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c; |
4298
|
|
|
|
|
|
|
+if eval $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then |
4299
|
|
|
|
|
|
|
+ val="$define"; |
4300
|
|
|
|
|
|
|
+else |
4301
|
|
|
|
|
|
|
+ val="$undef"; |
4302
|
|
|
|
|
|
|
+fi; |
4303
|
|
|
|
|
|
|
+set $varname; |
4304
|
|
|
|
|
|
|
+eval $setvar; |
4305
|
|
|
|
|
|
|
+$rm -f try.c try.o' |
4306
|
|
|
|
|
|
|
+ |
4307
|
|
|
|
|
|
|
: see if dlerror exists |
4308
|
|
|
|
|
|
|
xxx_runnm="$runnm" |
4309
|
|
|
|
|
|
|
runnm=false |
4310
|
|
|
|
|
|
|
@@ -7317,7 +7326,7 @@ esac |
4311
|
|
|
|
|
|
|
set netinet/in.h i_niin sys/in.h i_sysin |
4312
|
|
|
|
|
|
|
eval $inhdr |
4313
|
|
|
|
|
|
|
|
4314
|
|
|
|
|
|
|
-: see if this is an arpa/inet.h |
4315
|
|
|
|
|
|
|
+: see if arpa/inet.h has to be included |
4316
|
|
|
|
|
|
|
set arpa/inet.h i_arpainet |
4317
|
|
|
|
|
|
|
eval $inhdr |
4318
|
|
|
|
|
|
|
|
4319
|
|
|
|
|
|
|
@@ -7643,6 +7652,27 @@ echo " " |
4320
|
|
|
|
|
|
|
case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in |
4321
|
|
|
|
|
|
|
*"$undef"*) h_msg=false;; |
4322
|
|
|
|
|
|
|
esac |
4323
|
|
|
|
|
|
|
+ |
4324
|
|
|
|
|
|
|
+case "$osname" in |
4325
|
|
|
|
|
|
|
+freebsd) |
4326
|
|
|
|
|
|
|
+ case "`ipcs 2>&1`" in |
4327
|
|
|
|
|
|
|
+ "SVID messages"*"not configured"*) |
4328
|
|
|
|
|
|
|
+ echo "But your $osname does not have the msg*(2) configured." >&4 |
4329
|
|
|
|
|
|
|
+ h_msg=false |
4330
|
|
|
|
|
|
|
+ val="$undef" |
4331
|
|
|
|
|
|
|
+ set msgctl d_msgctl |
4332
|
|
|
|
|
|
|
+ eval $setvar |
4333
|
|
|
|
|
|
|
+ set msgget d_msgget |
4334
|
|
|
|
|
|
|
+ eval $setvar |
4335
|
|
|
|
|
|
|
+ set msgsnd d_msgsnd |
4336
|
|
|
|
|
|
|
+ eval $setvar |
4337
|
|
|
|
|
|
|
+ set msgrcv d_msgrcv |
4338
|
|
|
|
|
|
|
+ eval $setvar |
4339
|
|
|
|
|
|
|
+ ;; |
4340
|
|
|
|
|
|
|
+ esac |
4341
|
|
|
|
|
|
|
+ ;; |
4342
|
|
|
|
|
|
|
+esac |
4343
|
|
|
|
|
|
|
+ |
4344
|
|
|
|
|
|
|
: we could also check for sys/ipc.h ... |
4345
|
|
|
|
|
|
|
if $h_msg && $test `./findhdr sys/msg.h`; then |
4346
|
|
|
|
|
|
|
echo "You have the full msg*(2) library." >&4 |
4347
|
|
|
|
|
|
|
@@ -7671,7 +7701,7 @@ set poll d_poll |
4348
|
|
|
|
|
|
|
eval $inlibc |
4349
|
|
|
|
|
|
|
|
4350
|
|
|
|
|
|
|
|
4351
|
|
|
|
|
|
|
-: see whether the various POSIXish _yields exist within given cccmd |
4352
|
|
|
|
|
|
|
+: see whether the various POSIXish _yields exist |
4353
|
|
|
|
|
|
|
$cat >try.c <
|
4354
|
|
|
|
|
|
|
#include |
4355
|
|
|
|
|
|
|
main() { |
4356
|
|
|
|
|
|
|
@@ -8125,6 +8155,25 @@ echo " " |
4357
|
|
|
|
|
|
|
case "$d_semctl$d_semget$d_semop" in |
4358
|
|
|
|
|
|
|
*"$undef"*) h_sem=false;; |
4359
|
|
|
|
|
|
|
esac |
4360
|
|
|
|
|
|
|
+ |
4361
|
|
|
|
|
|
|
+case "$osname" in |
4362
|
|
|
|
|
|
|
+freebsd) |
4363
|
|
|
|
|
|
|
+ case "`ipcs 2>&1`" in |
4364
|
|
|
|
|
|
|
+ "SVID messages"*"not configured"*) |
4365
|
|
|
|
|
|
|
+ echo "But your $osname does not have the sem*(2) configured." >&4 |
4366
|
|
|
|
|
|
|
+ h_sem=false |
4367
|
|
|
|
|
|
|
+ val="$undef" |
4368
|
|
|
|
|
|
|
+ set semctl d_semctl |
4369
|
|
|
|
|
|
|
+ eval $setvar |
4370
|
|
|
|
|
|
|
+ set semget d_semget |
4371
|
|
|
|
|
|
|
+ eval $setvar |
4372
|
|
|
|
|
|
|
+ set semop d_semop |
4373
|
|
|
|
|
|
|
+ eval $setvar |
4374
|
|
|
|
|
|
|
+ ;; |
4375
|
|
|
|
|
|
|
+ esac |
4376
|
|
|
|
|
|
|
+ ;; |
4377
|
|
|
|
|
|
|
+esac |
4378
|
|
|
|
|
|
|
+ |
4379
|
|
|
|
|
|
|
: we could also check for sys/ipc.h ... |
4380
|
|
|
|
|
|
|
if $h_sem && $test `./findhdr sys/sem.h`; then |
4381
|
|
|
|
|
|
|
echo "You have the full sem*(2) library." >&4 |
4382
|
|
|
|
|
|
|
@@ -8161,6 +8210,31 @@ case "$d_sem" in |
4383
|
|
|
|
|
|
|
$define) |
4384
|
|
|
|
|
|
|
: see whether semctl IPC_STAT can use union semun |
4385
|
|
|
|
|
|
|
echo " " |
4386
|
|
|
|
|
|
|
+ $cat > try.h <
|
4387
|
|
|
|
|
|
|
+#ifndef S_IRUSR |
4388
|
|
|
|
|
|
|
+# ifdef S_IREAD |
4389
|
|
|
|
|
|
|
+# define S_IRUSR S_IREAD |
4390
|
|
|
|
|
|
|
+# define S_IWUSR S_IWRITE |
4391
|
|
|
|
|
|
|
+# define S_IXUSR S_IEXEC |
4392
|
|
|
|
|
|
|
+# else |
4393
|
|
|
|
|
|
|
+# define S_IRUSR 0400 |
4394
|
|
|
|
|
|
|
+# define S_IWUSR 0200 |
4395
|
|
|
|
|
|
|
+# define S_IXUSR 0100 |
4396
|
|
|
|
|
|
|
+# endif |
4397
|
|
|
|
|
|
|
+# define S_IRGRP (S_IRUSR>>3) |
4398
|
|
|
|
|
|
|
+# define S_IWGRP (S_IWUSR>>3) |
4399
|
|
|
|
|
|
|
+# define S_IXGRP (S_IXUSR>>3) |
4400
|
|
|
|
|
|
|
+# define S_IROTH (S_IRUSR>>6) |
4401
|
|
|
|
|
|
|
+# define S_IWOTH (S_IWUSR>>6) |
4402
|
|
|
|
|
|
|
+# define S_IXOTH (S_IXUSR>>6) |
4403
|
|
|
|
|
|
|
+#endif |
4404
|
|
|
|
|
|
|
+#ifndef S_IRWXU |
4405
|
|
|
|
|
|
|
+# define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR) |
4406
|
|
|
|
|
|
|
+# define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP) |
4407
|
|
|
|
|
|
|
+# define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH) |
4408
|
|
|
|
|
|
|
+#endif |
4409
|
|
|
|
|
|
|
+END |
4410
|
|
|
|
|
|
|
+ |
4411
|
|
|
|
|
|
|
$cat > try.c <
|
4412
|
|
|
|
|
|
|
#include |
4413
|
|
|
|
|
|
|
#include |
4414
|
|
|
|
|
|
|
@@ -8235,6 +8309,7 @@ END |
4415
|
|
|
|
|
|
|
#include |
4416
|
|
|
|
|
|
|
#include |
4417
|
|
|
|
|
|
|
#include |
4418
|
|
|
|
|
|
|
+#include "try.h" |
4419
|
|
|
|
|
|
|
#ifndef errno |
4420
|
|
|
|
|
|
|
extern int errno; |
4421
|
|
|
|
|
|
|
#endif |
4422
|
|
|
|
|
|
|
@@ -8281,6 +8356,7 @@ END |
4423
|
|
|
|
|
|
|
*) echo "You cannot use struct semid_ds * for semctl IPC_STAT." >&4 |
4424
|
|
|
|
|
|
|
;; |
4425
|
|
|
|
|
|
|
esac |
4426
|
|
|
|
|
|
|
+ $rm -f try.h |
4427
|
|
|
|
|
|
|
;; |
4428
|
|
|
|
|
|
|
*) val="$undef" |
4429
|
|
|
|
|
|
|
|
4430
|
|
|
|
|
|
|
@@ -8471,6 +8547,27 @@ echo " " |
4431
|
|
|
|
|
|
|
case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in |
4432
|
|
|
|
|
|
|
*"$undef"*) h_shm=false;; |
4433
|
|
|
|
|
|
|
esac |
4434
|
|
|
|
|
|
|
+ |
4435
|
|
|
|
|
|
|
+case "$osname" in |
4436
|
|
|
|
|
|
|
+freebsd) |
4437
|
|
|
|
|
|
|
+ case "`ipcs 2>&1`" in |
4438
|
|
|
|
|
|
|
+ "SVID shared memory"*"not configured"*) |
4439
|
|
|
|
|
|
|
+ echo "But your $osname does not have the shm*(2) configured." >&4 |
4440
|
|
|
|
|
|
|
+ h_shm=false |
4441
|
|
|
|
|
|
|
+ val="$undef" |
4442
|
|
|
|
|
|
|
+ set shmctl d_shmctl |
4443
|
|
|
|
|
|
|
+ evat $setvar |
4444
|
|
|
|
|
|
|
+ set shmget d_shmget |
4445
|
|
|
|
|
|
|
+ evat $setvar |
4446
|
|
|
|
|
|
|
+ set shmat d_shmat |
4447
|
|
|
|
|
|
|
+ evat $setvar |
4448
|
|
|
|
|
|
|
+ set shmdt d_shmdt |
4449
|
|
|
|
|
|
|
+ evat $setvar |
4450
|
|
|
|
|
|
|
+ ;; |
4451
|
|
|
|
|
|
|
+ esac |
4452
|
|
|
|
|
|
|
+ ;; |
4453
|
|
|
|
|
|
|
+esac |
4454
|
|
|
|
|
|
|
+ |
4455
|
|
|
|
|
|
|
: we could also check for sys/ipc.h ... |
4456
|
|
|
|
|
|
|
if $h_shm && $test `./findhdr sys/shm.h`; then |
4457
|
|
|
|
|
|
|
echo "You have the full shm*(2) library." >&4 |
4458
|
|
|
|
|
|
|
@@ -8609,21 +8706,8 @@ eval $inlibc |
4459
|
|
|
|
|
|
|
|
4460
|
|
|
|
|
|
|
: see if stat knows about block sizes |
4461
|
|
|
|
|
|
|
echo " " |
4462
|
|
|
|
|
|
|
-xxx=`./findhdr sys/stat.h` |
4463
|
|
|
|
|
|
|
-if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then |
4464
|
|
|
|
|
|
|
- if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then |
4465
|
|
|
|
|
|
|
- echo "Your stat() knows about block sizes." >&4 |
4466
|
|
|
|
|
|
|
- val="$define" |
4467
|
|
|
|
|
|
|
- else |
4468
|
|
|
|
|
|
|
- echo "Your stat() doesn't know about block sizes." >&4 |
4469
|
|
|
|
|
|
|
- val="$undef" |
4470
|
|
|
|
|
|
|
- fi |
4471
|
|
|
|
|
|
|
-else |
4472
|
|
|
|
|
|
|
- echo "Your stat() doesn't know about block sizes." >&4 |
4473
|
|
|
|
|
|
|
- val="$undef" |
4474
|
|
|
|
|
|
|
-fi |
4475
|
|
|
|
|
|
|
-set d_statblks |
4476
|
|
|
|
|
|
|
-eval $setvar |
4477
|
|
|
|
|
|
|
+set d_statblks stat st_blocks $i_sysstat sys/stat.h |
4478
|
|
|
|
|
|
|
+eval $hasfield |
4479
|
|
|
|
|
|
|
|
4480
|
|
|
|
|
|
|
: see if _ptr and _cnt from stdio act std |
4481
|
|
|
|
|
|
|
echo " " |
4482
|
|
|
|
|
|
|
@@ -9567,6 +9651,32 @@ EOCP |
4483
|
|
|
|
|
|
|
esac |
4484
|
|
|
|
|
|
|
$rm -f try.c try |
4485
|
|
|
|
|
|
|
|
4486
|
|
|
|
|
|
|
+echo " " |
4487
|
|
|
|
|
|
|
+echo "Determining whether or not we are on an EBCDIC system..." >&4 |
4488
|
|
|
|
|
|
|
+$cat >tebcdic.c <
|
4489
|
|
|
|
|
|
|
+int main() |
4490
|
|
|
|
|
|
|
+{ |
4491
|
|
|
|
|
|
|
+ if ('M'==0xd4) return 0; |
4492
|
|
|
|
|
|
|
+ return 1; |
4493
|
|
|
|
|
|
|
+} |
4494
|
|
|
|
|
|
|
+EOM |
4495
|
|
|
|
|
|
|
+val=$undef |
4496
|
|
|
|
|
|
|
+set tebcdic |
4497
|
|
|
|
|
|
|
+if eval $compile_ok; then |
4498
|
|
|
|
|
|
|
+ if ./tebcdic; then |
4499
|
|
|
|
|
|
|
+ echo "You have EBCDIC." >&4 |
4500
|
|
|
|
|
|
|
+ val="$define" |
4501
|
|
|
|
|
|
|
+ else |
4502
|
|
|
|
|
|
|
+ echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4 |
4503
|
|
|
|
|
|
|
+ fi |
4504
|
|
|
|
|
|
|
+else |
4505
|
|
|
|
|
|
|
+ echo "I'm unable to compile the test program." >&4 |
4506
|
|
|
|
|
|
|
+ echo "I'll assume ASCII or some ISO Latin." >&4 |
4507
|
|
|
|
|
|
|
+fi |
4508
|
|
|
|
|
|
|
+$rm -f tebcdic.c tebcdic |
4509
|
|
|
|
|
|
|
+set ebcdic |
4510
|
|
|
|
|
|
|
+eval $setvar |
4511
|
|
|
|
|
|
|
+ |
4512
|
|
|
|
|
|
|
: see what type file positions are declared as in the library |
4513
|
|
|
|
|
|
|
rp="What is the type for file position used by fsetpos()?" |
4514
|
|
|
|
|
|
|
set fpos_t fpostype long stdio.h sys/types.h |
4515
|
|
|
|
|
|
|
@@ -10174,8 +10284,10 @@ EOM |
4516
|
|
|
|
|
|
|
: The first arg can be int, unsigned, or size_t |
4517
|
|
|
|
|
|
|
: The last arg may or may not be 'const' |
4518
|
|
|
|
|
|
|
val='' |
4519
|
|
|
|
|
|
|
+ : void pointer has been seen but using that |
4520
|
|
|
|
|
|
|
+ : breaks the selectminbits test |
4521
|
|
|
|
|
|
|
for xxx in 'fd_set *' 'int *'; do |
4522
|
|
|
|
|
|
|
- for nfd in 'int' 'size_t' 'unsigned' ; do |
4523
|
|
|
|
|
|
|
+ for nfd in 'int' 'size_t' 'unsigned' 'unsigned long'; do |
4524
|
|
|
|
|
|
|
for tmo in 'struct timeval *' 'const struct timeval *'; do |
4525
|
|
|
|
|
|
|
case "$val" in |
4526
|
|
|
|
|
|
|
'') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));" |
4527
|
|
|
|
|
|
|
@@ -10207,6 +10319,100 @@ EOM |
4528
|
|
|
|
|
|
|
;; |
4529
|
|
|
|
|
|
|
esac |
4530
|
|
|
|
|
|
|
|
4531
|
|
|
|
|
|
|
+: check for the select 'width' |
4532
|
|
|
|
|
|
|
+case "$selectminbits" in |
4533
|
|
|
|
|
|
|
+'') case "$d_select" in |
4534
|
|
|
|
|
|
|
+ $define) |
4535
|
|
|
|
|
|
|
+ $cat <
|
4536
|
|
|
|
|
|
|
+ |
4537
|
|
|
|
|
|
|
+Checking to see on how many bits at a time your select() operates... |
4538
|
|
|
|
|
|
|
+EOM |
4539
|
|
|
|
|
|
|
+ $cat >try.c <
|
4540
|
|
|
|
|
|
|
+#include |
4541
|
|
|
|
|
|
|
+#$i_time I_TIME |
4542
|
|
|
|
|
|
|
+#$i_systime I_SYS_TIME |
4543
|
|
|
|
|
|
|
+#$i_systimek I_SYS_TIME_KERNEL |
4544
|
|
|
|
|
|
|
+#ifdef I_TIME |
4545
|
|
|
|
|
|
|
+# include |
4546
|
|
|
|
|
|
|
+#endif |
4547
|
|
|
|
|
|
|
+#ifdef I_SYS_TIME |
4548
|
|
|
|
|
|
|
+# ifdef I_SYS_TIME_KERNEL |
4549
|
|
|
|
|
|
|
+# define KERNEL |
4550
|
|
|
|
|
|
|
+# endif |
4551
|
|
|
|
|
|
|
+# include |
4552
|
|
|
|
|
|
|
+# ifdef I_SYS_TIME_KERNEL |
4553
|
|
|
|
|
|
|
+# undef KERNEL |
4554
|
|
|
|
|
|
|
+# endif |
4555
|
|
|
|
|
|
|
+#endif |
4556
|
|
|
|
|
|
|
+#$i_sysselct I_SYS_SELECT |
4557
|
|
|
|
|
|
|
+#ifdef I_SYS_SELECT |
4558
|
|
|
|
|
|
|
+#include |
4559
|
|
|
|
|
|
|
+#endif |
4560
|
|
|
|
|
|
|
+#include |
4561
|
|
|
|
|
|
|
+$selecttype b; |
4562
|
|
|
|
|
|
|
+#define S sizeof(*(b)) |
4563
|
|
|
|
|
|
|
+#define MINBITS 64 |
4564
|
|
|
|
|
|
|
+#define NBYTES (S * 8 > MINBITS ? S : MINBITS/8) |
4565
|
|
|
|
|
|
|
+#define NBITS (NBYTES * 8) |
4566
|
|
|
|
|
|
|
+int main() { |
4567
|
|
|
|
|
|
|
+ char s[NBYTES]; |
4568
|
|
|
|
|
|
|
+ struct timeval t; |
4569
|
|
|
|
|
|
|
+ int i; |
4570
|
|
|
|
|
|
|
+ FILE* fp; |
4571
|
|
|
|
|
|
|
+ int fd; |
4572
|
|
|
|
|
|
|
+ |
4573
|
|
|
|
|
|
|
+ fclose(stdin); |
4574
|
|
|
|
|
|
|
+ fp = fopen("try.c", "r"); |
4575
|
|
|
|
|
|
|
+ if (fp == 0) |
4576
|
|
|
|
|
|
|
+ exit(1); |
4577
|
|
|
|
|
|
|
+ fd = fileno(fp); |
4578
|
|
|
|
|
|
|
+ if (fd < 0) |
4579
|
|
|
|
|
|
|
+ exit(2); |
4580
|
|
|
|
|
|
|
+ b = ($selecttype)s; |
4581
|
|
|
|
|
|
|
+ for (i = 0; i < NBITS; i++) |
4582
|
|
|
|
|
|
|
+ FD_SET(i, b); |
4583
|
|
|
|
|
|
|
+ t.tv_sec = 0; |
4584
|
|
|
|
|
|
|
+ t.tv_usec = 0; |
4585
|
|
|
|
|
|
|
+ select(fd + 1, b, 0, 0, &t); |
4586
|
|
|
|
|
|
|
+ for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--); |
4587
|
|
|
|
|
|
|
+ printf("%d\n", i + 1); |
4588
|
|
|
|
|
|
|
+ return 0; |
4589
|
|
|
|
|
|
|
+} |
4590
|
|
|
|
|
|
|
+EOCP |
4591
|
|
|
|
|
|
|
+ set try |
4592
|
|
|
|
|
|
|
+ if eval $compile_ok; then |
4593
|
|
|
|
|
|
|
+ selectminbits=`./try` |
4594
|
|
|
|
|
|
|
+ case "$selectminbits" in |
4595
|
|
|
|
|
|
|
+ '') cat >&4 <
|
4596
|
|
|
|
|
|
|
+Cannot figure out on how many bits at a time your select() operates. |
4597
|
|
|
|
|
|
|
+I'll play safe and guess it is 32 bits. |
4598
|
|
|
|
|
|
|
+EOM |
4599
|
|
|
|
|
|
|
+ selectminbits=32 |
4600
|
|
|
|
|
|
|
+ bits="32 bits" |
4601
|
|
|
|
|
|
|
+ ;; |
4602
|
|
|
|
|
|
|
+ 1) bits="1 bit" ;; |
4603
|
|
|
|
|
|
|
+ *) bits="$selectminbits bits" ;; |
4604
|
|
|
|
|
|
|
+ esac |
4605
|
|
|
|
|
|
|
+ echo "Your select() operates on $bits at a time." >&4 |
4606
|
|
|
|
|
|
|
+ else |
4607
|
|
|
|
|
|
|
+ rp='What is the minimum number of bits your select() operates on?' |
4608
|
|
|
|
|
|
|
+ case "$byteorder" in |
4609
|
|
|
|
|
|
|
+ 1234|12345678) dflt=32 ;; |
4610
|
|
|
|
|
|
|
+ *) dflt=1 ;; |
4611
|
|
|
|
|
|
|
+ esac |
4612
|
|
|
|
|
|
|
+ . ./myread |
4613
|
|
|
|
|
|
|
+ val=$ans |
4614
|
|
|
|
|
|
|
+ selectminbits="$val" |
4615
|
|
|
|
|
|
|
+ fi |
4616
|
|
|
|
|
|
|
+ $rm -f try.* try |
4617
|
|
|
|
|
|
|
+ ;; |
4618
|
|
|
|
|
|
|
+ *) : no select, so pick a harmless default |
4619
|
|
|
|
|
|
|
+ selectminbits='32' |
4620
|
|
|
|
|
|
|
+ ;; |
4621
|
|
|
|
|
|
|
+ esac |
4622
|
|
|
|
|
|
|
+ ;; |
4623
|
|
|
|
|
|
|
+esac |
4624
|
|
|
|
|
|
|
+ |
4625
|
|
|
|
|
|
|
: Trace out the files included by signal.h, then look for SIGxxx names. |
4626
|
|
|
|
|
|
|
: Remove SIGARRAYSIZE used by HPUX. |
4627
|
|
|
|
|
|
|
: Remove SIGTYP void lines used by OS2. |
4628
|
|
|
|
|
|
|
@@ -10415,7 +10621,13 @@ $eunicefix signal_cmd |
4629
|
|
|
|
|
|
|
: generate list of signal names |
4630
|
|
|
|
|
|
|
echo " " |
4631
|
|
|
|
|
|
|
case "$sig_name_init" in |
4632
|
|
|
|
|
|
|
-'') |
4633
|
|
|
|
|
|
|
+'') doinit=yes ;; |
4634
|
|
|
|
|
|
|
+*) case "$sig_num_init" in |
4635
|
|
|
|
|
|
|
+ ''|*,*) doinit=yes ;; |
4636
|
|
|
|
|
|
|
+ esac ;; |
4637
|
|
|
|
|
|
|
+esac |
4638
|
|
|
|
|
|
|
+case "$doinit" in |
4639
|
|
|
|
|
|
|
+yes) |
4640
|
|
|
|
|
|
|
echo "Generating a list of signal names and numbers..." >&4 |
4641
|
|
|
|
|
|
|
. ./signal_cmd |
4642
|
|
|
|
|
|
|
sig_name=`$awk '{printf "%s ", $1}' signal.lst` |
4643
|
|
|
|
|
|
|
@@ -10423,7 +10635,9 @@ case "$sig_name_init" in |
4644
|
|
|
|
|
|
|
sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " } |
4645
|
|
|
|
|
|
|
{ printf "\"%s\", ", $1 } |
4646
|
|
|
|
|
|
|
END { printf "0\n" }' signal.lst` |
4647
|
|
|
|
|
|
|
- sig_num=`$awk 'BEGIN { printf "0, " } |
4648
|
|
|
|
|
|
|
+ sig_num=`$awk '{printf "%d ", $2}' signal.lst` |
4649
|
|
|
|
|
|
|
+ sig_num="0 $sig_num" |
4650
|
|
|
|
|
|
|
+ sig_num_init=`$awk 'BEGIN { printf "0, " } |
4651
|
|
|
|
|
|
|
{ printf "%d, ", $2} |
4652
|
|
|
|
|
|
|
END { printf "0\n"}' signal.lst` |
4653
|
|
|
|
|
|
|
;; |
4654
|
|
|
|
|
|
|
@@ -10787,7 +11001,13 @@ $rm -f try.c |
4655
|
|
|
|
|
|
|
EOS |
4656
|
|
|
|
|
|
|
chmod +x ccsym |
4657
|
|
|
|
|
|
|
$eunicefix ccsym |
4658
|
|
|
|
|
|
|
-./ccsym | $sort | $uniq >ccsym.raw |
4659
|
|
|
|
|
|
|
+./ccsym > ccsym1.raw |
4660
|
|
|
|
|
|
|
+if $test -s ccsym1.raw; then |
4661
|
|
|
|
|
|
|
+ $sort ccsym1.raw | $uniq >ccsym.raw |
4662
|
|
|
|
|
|
|
+else |
4663
|
|
|
|
|
|
|
+ mv ccsym1.raw ccsym.raw |
4664
|
|
|
|
|
|
|
+fi |
4665
|
|
|
|
|
|
|
+ |
4666
|
|
|
|
|
|
|
$awk '/\=/ { print $0; next } |
4667
|
|
|
|
|
|
|
{ print $0"=1" }' ccsym.raw >ccsym.list |
4668
|
|
|
|
|
|
|
$awk '{ print $0"=1" }' Cppsym.true >ccsym.true |
4669
|
|
|
|
|
|
|
@@ -11012,10 +11232,6 @@ eval $inhdr |
4670
|
|
|
|
|
|
|
set sys/resource.h i_sysresrc |
4671
|
|
|
|
|
|
|
eval $inhdr |
4672
|
|
|
|
|
|
|
|
4673
|
|
|
|
|
|
|
-: see if sys/stat.h is available |
4674
|
|
|
|
|
|
|
-set sys/stat.h i_sysstat |
4675
|
|
|
|
|
|
|
-eval $inhdr |
4676
|
|
|
|
|
|
|
- |
4677
|
|
|
|
|
|
|
: see if this is a sys/un.h system |
4678
|
|
|
|
|
|
|
set sys/un.h i_sysun |
4679
|
|
|
|
|
|
|
eval $inhdr |
4680
|
|
|
|
|
|
|
@@ -11152,6 +11368,7 @@ for xxx in $known_extensions ; do |
4681
|
|
|
|
|
|
|
esac |
4682
|
|
|
|
|
|
|
;; |
4683
|
|
|
|
|
|
|
IPC/SysV|ipc/sysv) |
4684
|
|
|
|
|
|
|
+ : XXX Do we need a useipcsysv variable here |
4685
|
|
|
|
|
|
|
case "${d_msg}${d_sem}${d_shm}" in |
4686
|
|
|
|
|
|
|
*"${define}"*) avail_ext="$avail_ext $xxx" ;; |
4687
|
|
|
|
|
|
|
esac |
4688
|
|
|
|
|
|
|
@@ -11731,6 +11948,7 @@ i_values='$i_values' |
4689
|
|
|
|
|
|
|
i_varargs='$i_varargs' |
4690
|
|
|
|
|
|
|
i_varhdr='$i_varhdr' |
4691
|
|
|
|
|
|
|
i_vfork='$i_vfork' |
4692
|
|
|
|
|
|
|
+ignore_versioned_solibs='$ignore_versioned_solibs' |
4693
|
|
|
|
|
|
|
incpath='$incpath' |
4694
|
|
|
|
|
|
|
inews='$inews' |
4695
|
|
|
|
|
|
|
installarchlib='$installarchlib' |
4696
|
|
|
|
|
|
|
@@ -11839,6 +12057,7 @@ runnm='$runnm' |
4697
|
|
|
|
|
|
|
scriptdir='$scriptdir' |
4698
|
|
|
|
|
|
|
scriptdirexp='$scriptdirexp' |
4699
|
|
|
|
|
|
|
sed='$sed' |
4700
|
|
|
|
|
|
|
+selectminbits='$selectminbits' |
4701
|
|
|
|
|
|
|
selecttype='$selecttype' |
4702
|
|
|
|
|
|
|
sendmail='$sendmail' |
4703
|
|
|
|
|
|
|
sh='$sh' |
4704
|
|
|
|
|
|
|
@@ -11851,6 +12070,7 @@ shsharp='$shsharp' |
4705
|
|
|
|
|
|
|
sig_name='$sig_name' |
4706
|
|
|
|
|
|
|
sig_name_init='$sig_name_init' |
4707
|
|
|
|
|
|
|
sig_num='$sig_num' |
4708
|
|
|
|
|
|
|
+sig_num_init='$sig_num_init' |
4709
|
|
|
|
|
|
|
signal_t='$signal_t' |
4710
|
|
|
|
|
|
|
sitearch='$sitearch' |
4711
|
|
|
|
|
|
|
sitearchexp='$sitearchexp' |
4712
|
|
|
|
|
|
|
--- Makefile.SH |
4713
|
|
|
|
|
|
|
+++ Makefile.SH |
4714
|
|
|
|
|
|
|
@@ -644,3 +644,83 @@ case `pwd` in |
4715
|
|
|
|
|
|
|
;; |
4716
|
|
|
|
|
|
|
esac |
4717
|
|
|
|
|
|
|
$rm -f $firstmakefile |
4718
|
|
|
|
|
|
|
+ |
4719
|
|
|
|
|
|
|
+# Now do any special processing required before building. |
4720
|
|
|
|
|
|
|
+ |
4721
|
|
|
|
|
|
|
+case "$ebcdic" in |
4722
|
|
|
|
|
|
|
+$define) |
4723
|
|
|
|
|
|
|
+ xxx='' |
4724
|
|
|
|
|
|
|
+ echo "This is an EBCDIC system, checking if any parser files need regenerating." >&4 |
4725
|
|
|
|
|
|
|
+case "$osname" in |
4726
|
|
|
|
|
|
|
+os390) |
4727
|
|
|
|
|
|
|
+ rm -f y.tab.c y.tab.h |
4728
|
|
|
|
|
|
|
+ yacc -d perly.y >/dev/null 2>&1 |
4729
|
|
|
|
|
|
|
+ if cmp -s y.tab.c perly.c; then |
4730
|
|
|
|
|
|
|
+ rm -f y.tab.c |
4731
|
|
|
|
|
|
|
+ else |
4732
|
|
|
|
|
|
|
+ echo "perly.y -> perly.c" >&2 |
4733
|
|
|
|
|
|
|
+ mv -f y.tab.c perly.c |
4734
|
|
|
|
|
|
|
+ chmod u+w perly.c |
4735
|
|
|
|
|
|
|
+ sed -e '/^#include "perl\.h"/a\ |
4736
|
|
|
|
|
|
|
+\ |
4737
|
|
|
|
|
|
|
+#define yydebug PL_yydebug\ |
4738
|
|
|
|
|
|
|
+#define yynerrs PL_yynerrs\ |
4739
|
|
|
|
|
|
|
+#define yyerrflag PL_yyerrflag\ |
4740
|
|
|
|
|
|
|
+#define yychar PL_yychar\ |
4741
|
|
|
|
|
|
|
+#define yyval PL_yyval\ |
4742
|
|
|
|
|
|
|
+#define yylval PL_yylval' \ |
4743
|
|
|
|
|
|
|
+ -e '/YYSTYPE *yyval;/D' \ |
4744
|
|
|
|
|
|
|
+ -e '/YYSTYPE *yylval;/D' \ |
4745
|
|
|
|
|
|
|
+ -e '/int yychar,/,/yynerrs;/D' \ |
4746
|
|
|
|
|
|
|
+ -e 's/int yydebug = 0;/yydebug = 0;/' \ |
4747
|
|
|
|
|
|
|
+ -e 's/[^_]realloc(/PerlMem_realloc(/g' \ |
4748
|
|
|
|
|
|
|
+ -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ |
4749
|
|
|
|
|
|
|
+ -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c |
4750
|
|
|
|
|
|
|
+ xxx="$xxx perly.c" |
4751
|
|
|
|
|
|
|
+ fi |
4752
|
|
|
|
|
|
|
+ if cmp -s y.tab.h perly.h; then |
4753
|
|
|
|
|
|
|
+ rm -f y.tab.h |
4754
|
|
|
|
|
|
|
+ else |
4755
|
|
|
|
|
|
|
+ echo "perly.y -> perly.h" >&2 |
4756
|
|
|
|
|
|
|
+ mv -f y.tab.h perly.h |
4757
|
|
|
|
|
|
|
+ xxx="$xxx perly.h" |
4758
|
|
|
|
|
|
|
+ fi |
4759
|
|
|
|
|
|
|
+ if cd x2p |
4760
|
|
|
|
|
|
|
+ then |
4761
|
|
|
|
|
|
|
+ rm -f y.tab.c y.tab.h |
4762
|
|
|
|
|
|
|
+ yacc a2p.y >/dev/null 2>&1 |
4763
|
|
|
|
|
|
|
+ if cmp -s y.tab.c a2p.c |
4764
|
|
|
|
|
|
|
+ then |
4765
|
|
|
|
|
|
|
+ rm -f y.tab.c |
4766
|
|
|
|
|
|
|
+ else |
4767
|
|
|
|
|
|
|
+ echo "a2p.y -> a2p.c" >&2 |
4768
|
|
|
|
|
|
|
+ mv -f y.tab.c a2p.c |
4769
|
|
|
|
|
|
|
+ chmod u+w a2p.c |
4770
|
|
|
|
|
|
|
+ sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ |
4771
|
|
|
|
|
|
|
+ -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c |
4772
|
|
|
|
|
|
|
+ xxx="$xxx a2p.c" |
4773
|
|
|
|
|
|
|
+ fi |
4774
|
|
|
|
|
|
|
+ # In case somebody yacc -d:ed the a2p.y. |
4775
|
|
|
|
|
|
|
+ if test -f y.tab.h |
4776
|
|
|
|
|
|
|
+ then |
4777
|
|
|
|
|
|
|
+ if cmp -s y.tab.h a2p.h |
4778
|
|
|
|
|
|
|
+ then |
4779
|
|
|
|
|
|
|
+ rm -f y.tab.h |
4780
|
|
|
|
|
|
|
+ else |
4781
|
|
|
|
|
|
|
+ echo "a2p.h -> a2p.h" >&2 |
4782
|
|
|
|
|
|
|
+ mv -f y.tab.h a2p.h |
4783
|
|
|
|
|
|
|
+ xxx="$xxx a2p.h" |
4784
|
|
|
|
|
|
|
+ fi |
4785
|
|
|
|
|
|
|
+ fi |
4786
|
|
|
|
|
|
|
+ cd .. |
4787
|
|
|
|
|
|
|
+ fi |
4788
|
|
|
|
|
|
|
+ ;; |
4789
|
|
|
|
|
|
|
+*) |
4790
|
|
|
|
|
|
|
+ echo "'$osname' is an EBCDIC system I don't know that well." >&4 |
4791
|
|
|
|
|
|
|
+ ;; |
4792
|
|
|
|
|
|
|
+esac |
4793
|
|
|
|
|
|
|
+ case "$xxx" in |
4794
|
|
|
|
|
|
|
+ '') echo "No parser files were regenerated. That's okay." >&2 ;; |
4795
|
|
|
|
|
|
|
+ esac |
4796
|
|
|
|
|
|
|
+ ;; |
4797
|
|
|
|
|
|
|
+esac |
4798
|
|
|
|
|
|
|
--- config_h.SH |
4799
|
|
|
|
|
|
|
+++ config_h.SH |
4800
|
|
|
|
|
|
|
@@ -1813,7 +1813,7 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- |
4801
|
|
|
|
|
|
|
* the sig_name list. |
4802
|
|
|
|
|
|
|
*/ |
4803
|
|
|
|
|
|
|
#define SIG_NAME $sig_name_init /**/ |
4804
|
|
|
|
|
|
|
-#define SIG_NUM $sig_num /**/ |
4805
|
|
|
|
|
|
|
+#define SIG_NUM $sig_num_init /**/ |
4806
|
|
|
|
|
|
|
|
4807
|
|
|
|
|
|
|
/* VOIDFLAGS: |
4808
|
|
|
|
|
|
|
* This symbol indicates how much support of the void type is given by this |
4809
|
|
|
|
|
|
|
@@ -1902,6 +1902,15 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- |
4810
|
|
|
|
|
|
|
#define PRIVLIB "$privlib" /**/ |
4811
|
|
|
|
|
|
|
#define PRIVLIB_EXP "$privlibexp" /**/ |
4812
|
|
|
|
|
|
|
|
4813
|
|
|
|
|
|
|
+/* SELECT_MIN_BITS: |
4814
|
|
|
|
|
|
|
+ * This symbol holds the minimum number of bits operated by select. |
4815
|
|
|
|
|
|
|
+ * That is, if you do select(n, ...), how many bits at least will be |
4816
|
|
|
|
|
|
|
+ * cleared in the masks if some activity is detected. Usually this |
4817
|
|
|
|
|
|
|
+ * is either n or 32*ceil(n/32), especially many little-endians do |
4818
|
|
|
|
|
|
|
+ * the latter. This is only useful if you have select(), naturally. |
4819
|
|
|
|
|
|
|
+ */ |
4820
|
|
|
|
|
|
|
+#define SELECT_MIN_BITS $selectminbits /**/ |
4821
|
|
|
|
|
|
|
+ |
4822
|
|
|
|
|
|
|
/* SITEARCH: |
4823
|
|
|
|
|
|
|
* This symbol contains the name of the private library for this package. |
4824
|
|
|
|
|
|
|
* The library is private in the sense that it needn't be in anyone's |
4825
|
|
|
|
|
|
|
--- pp_sys.c |
4826
|
|
|
|
|
|
|
+++ pp_sys.c |
4827
|
|
|
|
|
|
|
@@ -56,7 +56,10 @@ extern "C" int syscall(unsigned long,...); |
4828
|
|
|
|
|
|
|
|
4829
|
|
|
|
|
|
|
/* XXX Configure test needed. |
4830
|
|
|
|
|
|
|
h_errno might not be a simple 'int', especially for multi-threaded |
4831
|
|
|
|
|
|
|
- applications. HOST_NOT_FOUND is typically defined in . |
4832
|
|
|
|
|
|
|
+ applications, see "extern int errno in perl.h". Creating such |
4833
|
|
|
|
|
|
|
+ a test requires taking into account the differences between |
4834
|
|
|
|
|
|
|
+ compiling multithreaded and singlethreaded ($ccflags et al). |
4835
|
|
|
|
|
|
|
+ HOST_NOT_FOUND is typically defined in . |
4836
|
|
|
|
|
|
|
*/ |
4837
|
|
|
|
|
|
|
#if defined(HOST_NOT_FOUND) && !defined(h_errno) |
4838
|
|
|
|
|
|
|
extern int h_errno; |
4839
|
|
|
|
|
|
|
@@ -753,12 +756,17 @@ PP(pp_sselect) |
4840
|
|
|
|
|
|
|
maxlen = j; |
4841
|
|
|
|
|
|
|
} |
4842
|
|
|
|
|
|
|
|
4843
|
|
|
|
|
|
|
+/* little endians can use vecs directly */ |
4844
|
|
|
|
|
|
|
#if BYTEORDER == 0x1234 || BYTEORDER == 0x12345678 |
4845
|
|
|
|
|
|
|
-/* XXX Configure test needed. */ |
4846
|
|
|
|
|
|
|
-#if defined(__linux__) || defined(OS2) || defined(NeXT) || defined(__osf__) || defined(sun) |
4847
|
|
|
|
|
|
|
- growsize = sizeof(fd_set); |
4848
|
|
|
|
|
|
|
+# if SELECT_MIN_BITS > 1 |
4849
|
|
|
|
|
|
|
+ /* If SELECT_MIN_BITS is greater than one we most probably will want |
4850
|
|
|
|
|
|
|
+ * to align the sizes with SELECT_MIN_BITS/8 because for example |
4851
|
|
|
|
|
|
|
+ * in many little-endian (Intel, Alpha) systems (Linux, OS/2, Digital |
4852
|
|
|
|
|
|
|
+ * UNIX, Solaris, NeXT) the smallest quantum select() operates on |
4853
|
|
|
|
|
|
|
+ * (sets bit) is 32 bits. */ |
4854
|
|
|
|
|
|
|
+ growsize = maxlen + (SELECT_MIN_BITS/8 - (maxlen % (SELECT_MIN_BITS/8))); |
4855
|
|
|
|
|
|
|
#else |
4856
|
|
|
|
|
|
|
- growsize = maxlen; /* little endians can use vecs directly */ |
4857
|
|
|
|
|
|
|
+ growsize = sizeof(fd_set); |
4858
|
|
|
|
|
|
|
#endif |
4859
|
|
|
|
|
|
|
#else |
4860
|
|
|
|
|
|
|
#ifdef NFDBITS |
4861
|
|
|
|
|
|
|
END |
4862
|
|
|
|
|
|
|
} |
4863
|
|
|
|
|
|
|
|
4864
|
|
|
|
|
|
|
sub _patch_5_005 { |
4865
|
0
|
|
|
0
|
|
|
_patch(<<'END'); |
4866
|
|
|
|
|
|
|
--- Configure |
4867
|
|
|
|
|
|
|
+++ Configure |
4868
|
|
|
|
|
|
|
@@ -21,7 +21,7 @@ |
4869
|
|
|
|
|
|
|
# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ |
4870
|
|
|
|
|
|
|
# |
4871
|
|
|
|
|
|
|
# Generated on Tue Jul 7 10:10:21 EDT 1998 [metaconfig 3.0 PL70] |
4872
|
|
|
|
|
|
|
-# (with additional metaconfig patches by doughera@lafayette.edu) |
4873
|
|
|
|
|
|
|
+# (with additional metaconfig patches by jhi@iki.fi) |
4874
|
|
|
|
|
|
|
|
4875
|
|
|
|
|
|
|
cat >/tmp/c1$$ <
|
4876
|
|
|
|
|
|
|
ARGGGHHHH!!!!! |
4877
|
|
|
|
|
|
|
@@ -56,33 +56,6 @@ case "$0" in |
4878
|
|
|
|
|
|
|
;; |
4879
|
|
|
|
|
|
|
esac |
4880
|
|
|
|
|
|
|
|
4881
|
|
|
|
|
|
|
-: the newline for tr |
4882
|
|
|
|
|
|
|
-if test X"$trnl" = X; then |
4883
|
|
|
|
|
|
|
- case "`echo foo|tr '\n' x 2>/dev/null`" in |
4884
|
|
|
|
|
|
|
- foox) |
4885
|
|
|
|
|
|
|
- trnl='\n' |
4886
|
|
|
|
|
|
|
- ;; |
4887
|
|
|
|
|
|
|
- esac |
4888
|
|
|
|
|
|
|
-fi |
4889
|
|
|
|
|
|
|
-if test X"$trnl" = X; then |
4890
|
|
|
|
|
|
|
- case "`echo foo|tr '\012' x 2>/dev/null`" in |
4891
|
|
|
|
|
|
|
- foox) |
4892
|
|
|
|
|
|
|
- trnl='\012' |
4893
|
|
|
|
|
|
|
- ;; |
4894
|
|
|
|
|
|
|
- esac |
4895
|
|
|
|
|
|
|
-fi |
4896
|
|
|
|
|
|
|
-if test -n "$DJGPP"; then |
4897
|
|
|
|
|
|
|
- trnl='\012' |
4898
|
|
|
|
|
|
|
-fi |
4899
|
|
|
|
|
|
|
-if test X"$trnl" = X; then |
4900
|
|
|
|
|
|
|
- cat <&2 |
4901
|
|
|
|
|
|
|
- |
4902
|
|
|
|
|
|
|
-$me: Fatal Error: cannot figure out how to translate newlines with 'tr'. |
4903
|
|
|
|
|
|
|
- |
4904
|
|
|
|
|
|
|
-EOM |
4905
|
|
|
|
|
|
|
- exit 1 |
4906
|
|
|
|
|
|
|
-fi |
4907
|
|
|
|
|
|
|
- |
4908
|
|
|
|
|
|
|
: Proper separator for the PATH environment variable |
4909
|
|
|
|
|
|
|
p_=: |
4910
|
|
|
|
|
|
|
: On OS/2 this directory should exist if this is not floppy only system :-] |
4911
|
|
|
|
|
|
|
@@ -391,7 +364,6 @@ d_getservprotos='' |
4912
|
|
|
|
|
|
|
d_getsbyname='' |
4913
|
|
|
|
|
|
|
d_getsbyport='' |
4914
|
|
|
|
|
|
|
d_gnulibc='' |
4915
|
|
|
|
|
|
|
-i_arpainet='' |
4916
|
|
|
|
|
|
|
d_htonl='' |
4917
|
|
|
|
|
|
|
d_inetaton='' |
4918
|
|
|
|
|
|
|
d_isascii='' |
4919
|
|
|
|
|
|
|
@@ -540,6 +512,7 @@ dlsrc='' |
4920
|
|
|
|
|
|
|
ld='' |
4921
|
|
|
|
|
|
|
lddlflags='' |
4922
|
|
|
|
|
|
|
usedl='' |
4923
|
|
|
|
|
|
|
+ebcdic='' |
4924
|
|
|
|
|
|
|
doublesize='' |
4925
|
|
|
|
|
|
|
fpostype='' |
4926
|
|
|
|
|
|
|
gidtype='' |
4927
|
|
|
|
|
|
|
@@ -548,6 +521,7 @@ h_fcntl='' |
4928
|
|
|
|
|
|
|
h_sysfile='' |
4929
|
|
|
|
|
|
|
db_hashtype='' |
4930
|
|
|
|
|
|
|
db_prefixtype='' |
4931
|
|
|
|
|
|
|
+i_arpainet='' |
4932
|
|
|
|
|
|
|
i_db='' |
4933
|
|
|
|
|
|
|
i_dbm='' |
4934
|
|
|
|
|
|
|
i_rpcsvcdbm='' |
4935
|
|
|
|
|
|
|
@@ -633,6 +607,7 @@ libpth='' |
4936
|
|
|
|
|
|
|
loclibpth='' |
4937
|
|
|
|
|
|
|
plibpth='' |
4938
|
|
|
|
|
|
|
xlibpth='' |
4939
|
|
|
|
|
|
|
+ignore_versioned_solibs='' |
4940
|
|
|
|
|
|
|
libs='' |
4941
|
|
|
|
|
|
|
lns='' |
4942
|
|
|
|
|
|
|
lseektype='' |
4943
|
|
|
|
|
|
|
@@ -697,11 +672,13 @@ randbits='' |
4944
|
|
|
|
|
|
|
installscript='' |
4945
|
|
|
|
|
|
|
scriptdir='' |
4946
|
|
|
|
|
|
|
scriptdirexp='' |
4947
|
|
|
|
|
|
|
+selectminbits='' |
4948
|
|
|
|
|
|
|
selecttype='' |
4949
|
|
|
|
|
|
|
sh='' |
4950
|
|
|
|
|
|
|
sig_name='' |
4951
|
|
|
|
|
|
|
sig_name_init='' |
4952
|
|
|
|
|
|
|
sig_num='' |
4953
|
|
|
|
|
|
|
+sig_num_init='' |
4954
|
|
|
|
|
|
|
installsitearch='' |
4955
|
|
|
|
|
|
|
sitearch='' |
4956
|
|
|
|
|
|
|
sitearchexp='' |
4957
|
|
|
|
|
|
|
@@ -719,6 +696,7 @@ startperl='' |
4958
|
|
|
|
|
|
|
startsh='' |
4959
|
|
|
|
|
|
|
stdchar='' |
4960
|
|
|
|
|
|
|
sysman='' |
4961
|
|
|
|
|
|
|
+trnl='' |
4962
|
|
|
|
|
|
|
uidtype='' |
4963
|
|
|
|
|
|
|
nm_opt='' |
4964
|
|
|
|
|
|
|
nm_so_opt='' |
4965
|
|
|
|
|
|
|
@@ -733,7 +711,6 @@ mips_type='' |
4966
|
|
|
|
|
|
|
usrinc='' |
4967
|
|
|
|
|
|
|
defvoidused='' |
4968
|
|
|
|
|
|
|
voidflags='' |
4969
|
|
|
|
|
|
|
-ebcdic='' |
4970
|
|
|
|
|
|
|
CONFIG='' |
4971
|
|
|
|
|
|
|
|
4972
|
|
|
|
|
|
|
define='define' |
4973
|
|
|
|
|
|
|
@@ -836,6 +813,8 @@ plibpth='' |
4974
|
|
|
|
|
|
|
|
4975
|
|
|
|
|
|
|
: default library list |
4976
|
|
|
|
|
|
|
libswanted='' |
4977
|
|
|
|
|
|
|
+: some systems want only to use the non-versioned libso:s |
4978
|
|
|
|
|
|
|
+ignore_versioned_solibs='' |
4979
|
|
|
|
|
|
|
: Possible local include directories to search. |
4980
|
|
|
|
|
|
|
: Set locincpth to "" in a hint file to defeat local include searches. |
4981
|
|
|
|
|
|
|
locincpth="/usr/local/include /opt/local/include /usr/gnu/include" |
4982
|
|
|
|
|
|
|
@@ -904,7 +883,7 @@ case "$sh" in |
4983
|
|
|
|
|
|
|
$me: Fatal Error: I can't find a Bourne Shell anywhere. |
4984
|
|
|
|
|
|
|
|
4985
|
|
|
|
|
|
|
Usually it's in /bin/sh. How did you even get this far? |
4986
|
|
|
|
|
|
|
-Please contact me (Andy Dougherty) at doughera@lafayette.edu and |
4987
|
|
|
|
|
|
|
+Please contact me (Jarkko Hietaniemi) at jhi@iki.fi and |
4988
|
|
|
|
|
|
|
we'll try to straighten this all out. |
4989
|
|
|
|
|
|
|
EOM |
4990
|
|
|
|
|
|
|
exit 1 |
4991
|
|
|
|
|
|
|
@@ -1240,7 +1219,7 @@ cat >extract <<'EOS' |
4992
|
|
|
|
|
|
|
CONFIG=true |
4993
|
|
|
|
|
|
|
echo "Doing variable substitutions on .SH files..." |
4994
|
|
|
|
|
|
|
if test -f $src/MANIFEST; then |
4995
|
|
|
|
|
|
|
- set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH'` |
4996
|
|
|
|
|
|
|
+ set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'` |
4997
|
|
|
|
|
|
|
else |
4998
|
|
|
|
|
|
|
echo "(Looking for .SH files under the source directory.)" |
4999
|
|
|
|
|
|
|
set x `(cd $src; find . -name "*.SH" -print)` |
5000
|
|
|
|
|
|
|
@@ -1373,7 +1352,7 @@ THIS PACKAGE SEEMS TO BE INCOMPLETE. |
5001
|
|
|
|
|
|
|
You have the option of continuing the configuration process, despite the |
5002
|
|
|
|
|
|
|
distinct possibility that your kit is damaged, by typing 'y'es. If you |
5003
|
|
|
|
|
|
|
do, don't blame me if something goes wrong. I advise you to type 'n'o |
5004
|
|
|
|
|
|
|
-and contact the author (doughera@lafayette.edu). |
5005
|
|
|
|
|
|
|
+and contact the author (jhi@iki.fi). |
5006
|
|
|
|
|
|
|
|
5007
|
|
|
|
|
|
|
EOM |
5008
|
|
|
|
|
|
|
echo $n "Continue? [n] $c" >&4 |
5009
|
|
|
|
|
|
|
@@ -1396,6 +1375,30 @@ else |
5010
|
|
|
|
|
|
|
fi |
5011
|
|
|
|
|
|
|
rm -f missing x?? |
5012
|
|
|
|
|
|
|
|
5013
|
|
|
|
|
|
|
+echo " " |
5014
|
|
|
|
|
|
|
+: Find the appropriate value for a newline for tr |
5015
|
|
|
|
|
|
|
+if test -n "$DJGPP"; then |
5016
|
|
|
|
|
|
|
+ trnl='\012' |
5017
|
|
|
|
|
|
|
+fi |
5018
|
|
|
|
|
|
|
+if test X"$trnl" = X; then |
5019
|
|
|
|
|
|
|
+ case "`echo foo|tr '\n' x 2>/dev/null`" in |
5020
|
|
|
|
|
|
|
+ foox) trnl='\n' ;; |
5021
|
|
|
|
|
|
|
+ esac |
5022
|
|
|
|
|
|
|
+fi |
5023
|
|
|
|
|
|
|
+if test X"$trnl" = X; then |
5024
|
|
|
|
|
|
|
+ case "`echo foo|tr '\012' x 2>/dev/null`" in |
5025
|
|
|
|
|
|
|
+ foox) trnl='\012' ;; |
5026
|
|
|
|
|
|
|
+ esac |
5027
|
|
|
|
|
|
|
+fi |
5028
|
|
|
|
|
|
|
+if test X"$trnl" = X; then |
5029
|
|
|
|
|
|
|
+ cat <&2 |
5030
|
|
|
|
|
|
|
+ |
5031
|
|
|
|
|
|
|
+$me: Fatal Error: cannot figure out how to translate newlines with 'tr'. |
5032
|
|
|
|
|
|
|
+ |
5033
|
|
|
|
|
|
|
+EOM |
5034
|
|
|
|
|
|
|
+ exit 1 |
5035
|
|
|
|
|
|
|
+fi |
5036
|
|
|
|
|
|
|
+ |
5037
|
|
|
|
|
|
|
: compute the number of columns on the terminal for proper question formatting |
5038
|
|
|
|
|
|
|
case "$COLUMNS" in |
5039
|
|
|
|
|
|
|
'') COLUMNS='80';; |
5040
|
|
|
|
|
|
|
@@ -1574,7 +1577,7 @@ Much effort has been expended to ensure that this shell script will run on any |
5041
|
|
|
|
|
|
|
Unix system. If despite that it blows up on yours, your best bet is to edit |
5042
|
|
|
|
|
|
|
Configure and run it again. If you can't run Configure for some reason, |
5043
|
|
|
|
|
|
|
you'll have to generate a config.sh file by hand. Whatever problems you |
5044
|
|
|
|
|
|
|
-have, let me (doughera@lafayette.edu) know how I blew it. |
5045
|
|
|
|
|
|
|
+have, let me (jhi@iki.fi) know how I blew it. |
5046
|
|
|
|
|
|
|
|
5047
|
|
|
|
|
|
|
This installation script affects things in two ways: |
5048
|
|
|
|
|
|
|
|
5049
|
|
|
|
|
|
|
@@ -1841,14 +1844,14 @@ ABYZ) |
5050
|
|
|
|
|
|
|
*C9D1*|*c9d1*) |
5051
|
|
|
|
|
|
|
echo "Hey, this might be EBCDIC." >&4 |
5052
|
|
|
|
|
|
|
if test "X$up" = X -o "X$low" = X; then |
5053
|
|
|
|
|
|
|
- case "`echo IJ | tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in |
5054
|
|
|
|
|
|
|
+ case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in |
5055
|
|
|
|
|
|
|
ij) up='[A-IJ-RS-Z]' |
5056
|
|
|
|
|
|
|
low='[a-ij-rs-z]' |
5057
|
|
|
|
|
|
|
;; |
5058
|
|
|
|
|
|
|
esac |
5059
|
|
|
|
|
|
|
fi |
5060
|
|
|
|
|
|
|
if test "X$up" = X -o "X$low" = X; then |
5061
|
|
|
|
|
|
|
- case "`echo IJ | tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in |
5062
|
|
|
|
|
|
|
+ case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in |
5063
|
|
|
|
|
|
|
ij) up='A-IJ-RS-Z' |
5064
|
|
|
|
|
|
|
low='a-ij-rs-z' |
5065
|
|
|
|
|
|
|
;; |
5066
|
|
|
|
|
|
|
@@ -1941,7 +1944,7 @@ EOM |
5067
|
|
|
|
|
|
|
(cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4 |
5068
|
|
|
|
|
|
|
dflt='' |
5069
|
|
|
|
|
|
|
: Half the following guesses are probably wrong... If you have better |
5070
|
|
|
|
|
|
|
- : tests or hints, please send them to doughera@lafayette.edu |
5071
|
|
|
|
|
|
|
+ : tests or hints, please send them to jhi@iki.fi |
5072
|
|
|
|
|
|
|
: The metaconfig authors would also appreciate a copy... |
5073
|
|
|
|
|
|
|
$test -f /irix && osname=irix |
5074
|
|
|
|
|
|
|
$test -f /xenix && osname=sco_xenix |
5075
|
|
|
|
|
|
|
@@ -2025,7 +2028,7 @@ EOM |
5076
|
|
|
|
|
|
|
osvers="$3" |
5077
|
|
|
|
|
|
|
;; |
5078
|
|
|
|
|
|
|
dynixptx*) osname=dynixptx |
5079
|
|
|
|
|
|
|
- osvers="$3" |
5080
|
|
|
|
|
|
|
+ osvers=`echo "$4" | $sed 's/^v//'` |
5081
|
|
|
|
|
|
|
;; |
5082
|
|
|
|
|
|
|
freebsd) osname=freebsd |
5083
|
|
|
|
|
|
|
osvers="$3" ;; |
5084
|
|
|
|
|
|
|
@@ -3454,7 +3457,11 @@ cat <<'EOT' >testcpp.c |
5085
|
|
|
|
|
|
|
ABC.XYZ |
5086
|
|
|
|
|
|
|
EOT |
5087
|
|
|
|
|
|
|
cd .. |
5088
|
|
|
|
|
|
|
+if test ! -f cppstdin; then |
5089
|
|
|
|
|
|
|
echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin |
5090
|
|
|
|
|
|
|
+else |
5091
|
|
|
|
|
|
|
+ echo "Keeping your $hint cppstdin wrapper." |
5092
|
|
|
|
|
|
|
+fi |
5093
|
|
|
|
|
|
|
chmod 755 cppstdin |
5094
|
|
|
|
|
|
|
wrapper=`pwd`/cppstdin |
5095
|
|
|
|
|
|
|
ok='false' |
5096
|
|
|
|
|
|
|
@@ -3705,7 +3712,8 @@ case "$libswanted" in |
5097
|
|
|
|
|
|
|
esac |
5098
|
|
|
|
|
|
|
for thislib in $libswanted; do |
5099
|
|
|
|
|
|
|
|
5100
|
|
|
|
|
|
|
- if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then |
5101
|
|
|
|
|
|
|
+ if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; |
5102
|
|
|
|
|
|
|
+ $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then |
5103
|
|
|
|
|
|
|
echo "Found -l$thislib (shared)." |
5104
|
|
|
|
|
|
|
case " $dflt " in |
5105
|
|
|
|
|
|
|
*"-l$thislib "*);; |
5106
|
|
|
|
|
|
|
@@ -3992,10 +4000,21 @@ rmlist="$rmlist pdp11" |
5107
|
|
|
|
|
|
|
: coherency check |
5108
|
|
|
|
|
|
|
echo " " |
5109
|
|
|
|
|
|
|
echo "Checking your choice of C compiler and flags for coherency..." >&4 |
5110
|
|
|
|
|
|
|
+$cat > try.c <<'EOF' |
5111
|
|
|
|
|
|
|
+#include |
5112
|
|
|
|
|
|
|
+main() { printf("Ok\n"); exit(0); } |
5113
|
|
|
|
|
|
|
+EOF |
5114
|
|
|
|
|
|
|
set X $cc $optimize $ccflags -o try $ldflags try.c $libs |
5115
|
|
|
|
|
|
|
shift |
5116
|
|
|
|
|
|
|
-$cat >try.msg <
|
5117
|
|
|
|
|
|
|
-I've tried to compile and run a simple program with: |
5118
|
|
|
|
|
|
|
+$cat >try.msg <<'EOM' |
5119
|
|
|
|
|
|
|
+I've tried to compile and run the following simple program: |
5120
|
|
|
|
|
|
|
+ |
5121
|
|
|
|
|
|
|
+EOM |
5122
|
|
|
|
|
|
|
+$cat try.c |
5123
|
|
|
|
|
|
|
+ |
5124
|
|
|
|
|
|
|
+$cat >> try.msg <
|
5125
|
|
|
|
|
|
|
+ |
5126
|
|
|
|
|
|
|
+I used the command: |
5127
|
|
|
|
|
|
|
|
5128
|
|
|
|
|
|
|
$* |
5129
|
|
|
|
|
|
|
./try |
5130
|
|
|
|
|
|
|
@@ -4003,10 +4022,6 @@ I've tried to compile and run a simple program with: |
5131
|
|
|
|
|
|
|
and I got the following output: |
5132
|
|
|
|
|
|
|
|
5133
|
|
|
|
|
|
|
EOM |
5134
|
|
|
|
|
|
|
-$cat > try.c <<'EOF' |
5135
|
|
|
|
|
|
|
-#include |
5136
|
|
|
|
|
|
|
-main() { printf("Ok\n"); exit(0); } |
5137
|
|
|
|
|
|
|
-EOF |
5138
|
|
|
|
|
|
|
dflt=y |
5139
|
|
|
|
|
|
|
if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then |
5140
|
|
|
|
|
|
|
if sh -c './try' >>try.msg 2>&1; then |
5141
|
|
|
|
|
|
|
@@ -4043,7 +4058,7 @@ y) |
5142
|
|
|
|
|
|
|
$cat try.msg >&4 |
5143
|
|
|
|
|
|
|
case "$knowitall" in |
5144
|
|
|
|
|
|
|
'') |
5145
|
|
|
|
|
|
|
- echo "(The supplied flags might be incorrect with this C compiler.)" |
5146
|
|
|
|
|
|
|
+ echo "(The supplied flags or libraries might be incorrect.)" |
5147
|
|
|
|
|
|
|
;; |
5148
|
|
|
|
|
|
|
*) dflt=n;; |
5149
|
|
|
|
|
|
|
esac |
5150
|
|
|
|
|
|
|
@@ -4161,9 +4176,8 @@ eval $inhdr |
5151
|
|
|
|
|
|
|
: determine which malloc to compile in |
5152
|
|
|
|
|
|
|
echo " " |
5153
|
|
|
|
|
|
|
case "$usemymalloc" in |
5154
|
|
|
|
|
|
|
-''|y*|true) dflt='y' ;; |
5155
|
|
|
|
|
|
|
-n*|false) dflt='n' ;; |
5156
|
|
|
|
|
|
|
-*) dflt="$usemymalloc" ;; |
5157
|
|
|
|
|
|
|
+''|[yY]*|true|$define) dflt='y' ;; |
5158
|
|
|
|
|
|
|
+*) dflt='n' ;; |
5159
|
|
|
|
|
|
|
esac |
5160
|
|
|
|
|
|
|
rp="Do you wish to attempt to use the malloc that comes with $package?" |
5161
|
|
|
|
|
|
|
. ./myread |
5162
|
|
|
|
|
|
|
@@ -4265,7 +4279,7 @@ understands function prototypes. Unfortunately, your C compiler |
5163
|
|
|
|
|
|
|
$cc $ccflags |
5164
|
|
|
|
|
|
|
doesn't seem to understand them. Sorry about that. |
5165
|
|
|
|
|
|
|
|
5166
|
|
|
|
|
|
|
-If GNU cc is avaiable for your system, perhaps you could try that instead. |
5167
|
|
|
|
|
|
|
+If GNU cc is available for your system, perhaps you could try that instead. |
5168
|
|
|
|
|
|
|
|
5169
|
|
|
|
|
|
|
Eventually, we hope to support building Perl with pre-ANSI compilers. |
5170
|
|
|
|
|
|
|
If you would like to help in that effort, please contact . |
5171
|
|
|
|
|
|
|
@@ -4320,32 +4334,6 @@ shift; |
5172
|
|
|
|
|
|
|
$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;' |
5173
|
|
|
|
|
|
|
|
5174
|
|
|
|
|
|
|
echo " " |
5175
|
|
|
|
|
|
|
-echo "Determining whether or not we are on an EBCDIC system..." >&4 |
5176
|
|
|
|
|
|
|
-cat >tebcdic.c <
|
5177
|
|
|
|
|
|
|
-int main() |
5178
|
|
|
|
|
|
|
-{ |
5179
|
|
|
|
|
|
|
- if ('M'==0xd4) return 0; |
5180
|
|
|
|
|
|
|
- return 1; |
5181
|
|
|
|
|
|
|
-} |
5182
|
|
|
|
|
|
|
-EOM |
5183
|
|
|
|
|
|
|
-val=$undef |
5184
|
|
|
|
|
|
|
-set tebcdic |
5185
|
|
|
|
|
|
|
-if eval $compile_ok; then |
5186
|
|
|
|
|
|
|
- if ./tebcdic; then |
5187
|
|
|
|
|
|
|
- echo "You have EBCDIC." >&4 |
5188
|
|
|
|
|
|
|
- val="$define" |
5189
|
|
|
|
|
|
|
- else |
5190
|
|
|
|
|
|
|
- echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4 |
5191
|
|
|
|
|
|
|
- fi |
5192
|
|
|
|
|
|
|
-else |
5193
|
|
|
|
|
|
|
- echo "I'm unable to compile the test program." >&4 |
5194
|
|
|
|
|
|
|
- echo "I'll asuume ASCII or some ISO Latin." >&4 |
5195
|
|
|
|
|
|
|
-fi |
5196
|
|
|
|
|
|
|
-$rm -f tebcdic.c tebcdic |
5197
|
|
|
|
|
|
|
-set ebcdic |
5198
|
|
|
|
|
|
|
-eval $setvar |
5199
|
|
|
|
|
|
|
- |
5200
|
|
|
|
|
|
|
-echo " " |
5201
|
|
|
|
|
|
|
echo "Checking for GNU C Library..." >&4 |
5202
|
|
|
|
|
|
|
cat >gnulibc.c <
|
5203
|
|
|
|
|
|
|
#include |
5204
|
|
|
|
|
|
|
@@ -5159,7 +5147,7 @@ case "$shrpdir" in |
5205
|
|
|
|
|
|
|
*) $cat >&4 <
|
5206
|
|
|
|
|
|
|
WARNING: Use of the shrpdir variable for the installation location of |
5207
|
|
|
|
|
|
|
the shared $libperl is not supported. It was never documented and |
5208
|
|
|
|
|
|
|
-will not work in this version. Let me (doughera@lafayette.edu) |
5209
|
|
|
|
|
|
|
+will not work in this version. Let me (jhi@iki.fi) |
5210
|
|
|
|
|
|
|
know of any problems this may cause. |
5211
|
|
|
|
|
|
|
|
5212
|
|
|
|
|
|
|
EOM |
5213
|
|
|
|
|
|
|
@@ -6715,6 +6703,10 @@ eval $setvar |
5214
|
|
|
|
|
|
|
set difftime d_difftime |
5215
|
|
|
|
|
|
|
eval $inlibc |
5216
|
|
|
|
|
|
|
|
5217
|
|
|
|
|
|
|
+: see if sys/stat.h is available |
5218
|
|
|
|
|
|
|
+set sys/stat.h i_sysstat |
5219
|
|
|
|
|
|
|
+eval $inhdr |
5220
|
|
|
|
|
|
|
+ |
5221
|
|
|
|
|
|
|
: see if this is a dirent system |
5222
|
|
|
|
|
|
|
echo " " |
5223
|
|
|
|
|
|
|
if xinc=`./findhdr dirent.h`; $test "$xinc"; then |
5224
|
|
|
|
|
|
|
@@ -6783,6 +6775,23 @@ set d_dirnamlen |
5225
|
|
|
|
|
|
|
eval $setvar |
5226
|
|
|
|
|
|
|
$rm -f try.c |
5227
|
|
|
|
|
|
|
|
5228
|
|
|
|
|
|
|
+hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift; |
5229
|
|
|
|
|
|
|
+while $test $# -ge 2; do |
5230
|
|
|
|
|
|
|
+ case "$1" in |
5231
|
|
|
|
|
|
|
+ $define) echo "#include <$2>";; |
5232
|
|
|
|
|
|
|
+ esac ; |
5233
|
|
|
|
|
|
|
+ shift 2; |
5234
|
|
|
|
|
|
|
+done > try.c; |
5235
|
|
|
|
|
|
|
+echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c; |
5236
|
|
|
|
|
|
|
+if eval $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then |
5237
|
|
|
|
|
|
|
+ val="$define"; |
5238
|
|
|
|
|
|
|
+else |
5239
|
|
|
|
|
|
|
+ val="$undef"; |
5240
|
|
|
|
|
|
|
+fi; |
5241
|
|
|
|
|
|
|
+set $varname; |
5242
|
|
|
|
|
|
|
+eval $setvar; |
5243
|
|
|
|
|
|
|
+$rm -f try.c try.o' |
5244
|
|
|
|
|
|
|
+ |
5245
|
|
|
|
|
|
|
: see if dlerror exists |
5246
|
|
|
|
|
|
|
xxx_runnm="$runnm" |
5247
|
|
|
|
|
|
|
runnm=false |
5248
|
|
|
|
|
|
|
@@ -7317,7 +7326,7 @@ esac |
5249
|
|
|
|
|
|
|
set netinet/in.h i_niin sys/in.h i_sysin |
5250
|
|
|
|
|
|
|
eval $inhdr |
5251
|
|
|
|
|
|
|
|
5252
|
|
|
|
|
|
|
-: see if this is an arpa/inet.h |
5253
|
|
|
|
|
|
|
+: see if arpa/inet.h has to be included |
5254
|
|
|
|
|
|
|
set arpa/inet.h i_arpainet |
5255
|
|
|
|
|
|
|
eval $inhdr |
5256
|
|
|
|
|
|
|
|
5257
|
|
|
|
|
|
|
@@ -7643,6 +7652,27 @@ echo " " |
5258
|
|
|
|
|
|
|
case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in |
5259
|
|
|
|
|
|
|
*"$undef"*) h_msg=false;; |
5260
|
|
|
|
|
|
|
esac |
5261
|
|
|
|
|
|
|
+ |
5262
|
|
|
|
|
|
|
+case "$osname" in |
5263
|
|
|
|
|
|
|
+freebsd) |
5264
|
|
|
|
|
|
|
+ case "`ipcs 2>&1`" in |
5265
|
|
|
|
|
|
|
+ "SVID messages"*"not configured"*) |
5266
|
|
|
|
|
|
|
+ echo "But your $osname does not have the msg*(2) configured." >&4 |
5267
|
|
|
|
|
|
|
+ h_msg=false |
5268
|
|
|
|
|
|
|
+ val="$undef" |
5269
|
|
|
|
|
|
|
+ set msgctl d_msgctl |
5270
|
|
|
|
|
|
|
+ eval $setvar |
5271
|
|
|
|
|
|
|
+ set msgget d_msgget |
5272
|
|
|
|
|
|
|
+ eval $setvar |
5273
|
|
|
|
|
|
|
+ set msgsnd d_msgsnd |
5274
|
|
|
|
|
|
|
+ eval $setvar |
5275
|
|
|
|
|
|
|
+ set msgrcv d_msgrcv |
5276
|
|
|
|
|
|
|
+ eval $setvar |
5277
|
|
|
|
|
|
|
+ ;; |
5278
|
|
|
|
|
|
|
+ esac |
5279
|
|
|
|
|
|
|
+ ;; |
5280
|
|
|
|
|
|
|
+esac |
5281
|
|
|
|
|
|
|
+ |
5282
|
|
|
|
|
|
|
: we could also check for sys/ipc.h ... |
5283
|
|
|
|
|
|
|
if $h_msg && $test `./findhdr sys/msg.h`; then |
5284
|
|
|
|
|
|
|
echo "You have the full msg*(2) library." >&4 |
5285
|
|
|
|
|
|
|
@@ -7671,7 +7701,7 @@ set poll d_poll |
5286
|
|
|
|
|
|
|
eval $inlibc |
5287
|
|
|
|
|
|
|
|
5288
|
|
|
|
|
|
|
|
5289
|
|
|
|
|
|
|
-: see whether the various POSIXish _yields exist within given cccmd |
5290
|
|
|
|
|
|
|
+: see whether the various POSIXish _yields exist |
5291
|
|
|
|
|
|
|
$cat >try.c <
|
5292
|
|
|
|
|
|
|
#include |
5293
|
|
|
|
|
|
|
main() { |
5294
|
|
|
|
|
|
|
@@ -8125,6 +8155,25 @@ echo " " |
5295
|
|
|
|
|
|
|
case "$d_semctl$d_semget$d_semop" in |
5296
|
|
|
|
|
|
|
*"$undef"*) h_sem=false;; |
5297
|
|
|
|
|
|
|
esac |
5298
|
|
|
|
|
|
|
+ |
5299
|
|
|
|
|
|
|
+case "$osname" in |
5300
|
|
|
|
|
|
|
+freebsd) |
5301
|
|
|
|
|
|
|
+ case "`ipcs 2>&1`" in |
5302
|
|
|
|
|
|
|
+ "SVID messages"*"not configured"*) |
5303
|
|
|
|
|
|
|
+ echo "But your $osname does not have the sem*(2) configured." >&4 |
5304
|
|
|
|
|
|
|
+ h_sem=false |
5305
|
|
|
|
|
|
|
+ val="$undef" |
5306
|
|
|
|
|
|
|
+ set semctl d_semctl |
5307
|
|
|
|
|
|
|
+ eval $setvar |
5308
|
|
|
|
|
|
|
+ set semget d_semget |
5309
|
|
|
|
|
|
|
+ eval $setvar |
5310
|
|
|
|
|
|
|
+ set semop d_semop |
5311
|
|
|
|
|
|
|
+ eval $setvar |
5312
|
|
|
|
|
|
|
+ ;; |
5313
|
|
|
|
|
|
|
+ esac |
5314
|
|
|
|
|
|
|
+ ;; |
5315
|
|
|
|
|
|
|
+esac |
5316
|
|
|
|
|
|
|
+ |
5317
|
|
|
|
|
|
|
: we could also check for sys/ipc.h ... |
5318
|
|
|
|
|
|
|
if $h_sem && $test `./findhdr sys/sem.h`; then |
5319
|
|
|
|
|
|
|
echo "You have the full sem*(2) library." >&4 |
5320
|
|
|
|
|
|
|
@@ -8161,6 +8210,31 @@ case "$d_sem" in |
5321
|
|
|
|
|
|
|
$define) |
5322
|
|
|
|
|
|
|
: see whether semctl IPC_STAT can use union semun |
5323
|
|
|
|
|
|
|
echo " " |
5324
|
|
|
|
|
|
|
+ $cat > try.h <
|
5325
|
|
|
|
|
|
|
+#ifndef S_IRUSR |
5326
|
|
|
|
|
|
|
+# ifdef S_IREAD |
5327
|
|
|
|
|
|
|
+# define S_IRUSR S_IREAD |
5328
|
|
|
|
|
|
|
+# define S_IWUSR S_IWRITE |
5329
|
|
|
|
|
|
|
+# define S_IXUSR S_IEXEC |
5330
|
|
|
|
|
|
|
+# else |
5331
|
|
|
|
|
|
|
+# define S_IRUSR 0400 |
5332
|
|
|
|
|
|
|
+# define S_IWUSR 0200 |
5333
|
|
|
|
|
|
|
+# define S_IXUSR 0100 |
5334
|
|
|
|
|
|
|
+# endif |
5335
|
|
|
|
|
|
|
+# define S_IRGRP (S_IRUSR>>3) |
5336
|
|
|
|
|
|
|
+# define S_IWGRP (S_IWUSR>>3) |
5337
|
|
|
|
|
|
|
+# define S_IXGRP (S_IXUSR>>3) |
5338
|
|
|
|
|
|
|
+# define S_IROTH (S_IRUSR>>6) |
5339
|
|
|
|
|
|
|
+# define S_IWOTH (S_IWUSR>>6) |
5340
|
|
|
|
|
|
|
+# define S_IXOTH (S_IXUSR>>6) |
5341
|
|
|
|
|
|
|
+#endif |
5342
|
|
|
|
|
|
|
+#ifndef S_IRWXU |
5343
|
|
|
|
|
|
|
+# define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR) |
5344
|
|
|
|
|
|
|
+# define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP) |
5345
|
|
|
|
|
|
|
+# define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH) |
5346
|
|
|
|
|
|
|
+#endif |
5347
|
|
|
|
|
|
|
+END |
5348
|
|
|
|
|
|
|
+ |
5349
|
|
|
|
|
|
|
$cat > try.c <
|
5350
|
|
|
|
|
|
|
#include |
5351
|
|
|
|
|
|
|
#include |
5352
|
|
|
|
|
|
|
@@ -8235,6 +8309,7 @@ END |
5353
|
|
|
|
|
|
|
#include |
5354
|
|
|
|
|
|
|
#include |
5355
|
|
|
|
|
|
|
#include |
5356
|
|
|
|
|
|
|
+#include "try.h" |
5357
|
|
|
|
|
|
|
#ifndef errno |
5358
|
|
|
|
|
|
|
extern int errno; |
5359
|
|
|
|
|
|
|
#endif |
5360
|
|
|
|
|
|
|
@@ -8281,6 +8356,7 @@ END |
5361
|
|
|
|
|
|
|
*) echo "You cannot use struct semid_ds * for semctl IPC_STAT." >&4 |
5362
|
|
|
|
|
|
|
;; |
5363
|
|
|
|
|
|
|
esac |
5364
|
|
|
|
|
|
|
+ $rm -f try.h |
5365
|
|
|
|
|
|
|
;; |
5366
|
|
|
|
|
|
|
*) val="$undef" |
5367
|
|
|
|
|
|
|
|
5368
|
|
|
|
|
|
|
@@ -8471,6 +8547,27 @@ echo " " |
5369
|
|
|
|
|
|
|
case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in |
5370
|
|
|
|
|
|
|
*"$undef"*) h_shm=false;; |
5371
|
|
|
|
|
|
|
esac |
5372
|
|
|
|
|
|
|
+ |
5373
|
|
|
|
|
|
|
+case "$osname" in |
5374
|
|
|
|
|
|
|
+freebsd) |
5375
|
|
|
|
|
|
|
+ case "`ipcs 2>&1`" in |
5376
|
|
|
|
|
|
|
+ "SVID shared memory"*"not configured"*) |
5377
|
|
|
|
|
|
|
+ echo "But your $osname does not have the shm*(2) configured." >&4 |
5378
|
|
|
|
|
|
|
+ h_shm=false |
5379
|
|
|
|
|
|
|
+ val="$undef" |
5380
|
|
|
|
|
|
|
+ set shmctl d_shmctl |
5381
|
|
|
|
|
|
|
+ evat $setvar |
5382
|
|
|
|
|
|
|
+ set shmget d_shmget |
5383
|
|
|
|
|
|
|
+ evat $setvar |
5384
|
|
|
|
|
|
|
+ set shmat d_shmat |
5385
|
|
|
|
|
|
|
+ evat $setvar |
5386
|
|
|
|
|
|
|
+ set shmdt d_shmdt |
5387
|
|
|
|
|
|
|
+ evat $setvar |
5388
|
|
|
|
|
|
|
+ ;; |
5389
|
|
|
|
|
|
|
+ esac |
5390
|
|
|
|
|
|
|
+ ;; |
5391
|
|
|
|
|
|
|
+esac |
5392
|
|
|
|
|
|
|
+ |
5393
|
|
|
|
|
|
|
: we could also check for sys/ipc.h ... |
5394
|
|
|
|
|
|
|
if $h_shm && $test `./findhdr sys/shm.h`; then |
5395
|
|
|
|
|
|
|
echo "You have the full shm*(2) library." >&4 |
5396
|
|
|
|
|
|
|
@@ -8609,21 +8706,8 @@ eval $inlibc |
5397
|
|
|
|
|
|
|
|
5398
|
|
|
|
|
|
|
: see if stat knows about block sizes |
5399
|
|
|
|
|
|
|
echo " " |
5400
|
|
|
|
|
|
|
-xxx=`./findhdr sys/stat.h` |
5401
|
|
|
|
|
|
|
-if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then |
5402
|
|
|
|
|
|
|
- if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then |
5403
|
|
|
|
|
|
|
- echo "Your stat() knows about block sizes." >&4 |
5404
|
|
|
|
|
|
|
- val="$define" |
5405
|
|
|
|
|
|
|
- else |
5406
|
|
|
|
|
|
|
- echo "Your stat() doesn't know about block sizes." >&4 |
5407
|
|
|
|
|
|
|
- val="$undef" |
5408
|
|
|
|
|
|
|
- fi |
5409
|
|
|
|
|
|
|
-else |
5410
|
|
|
|
|
|
|
- echo "Your stat() doesn't know about block sizes." >&4 |
5411
|
|
|
|
|
|
|
- val="$undef" |
5412
|
|
|
|
|
|
|
-fi |
5413
|
|
|
|
|
|
|
-set d_statblks |
5414
|
|
|
|
|
|
|
-eval $setvar |
5415
|
|
|
|
|
|
|
+set d_statblks stat st_blocks $i_sysstat sys/stat.h |
5416
|
|
|
|
|
|
|
+eval $hasfield |
5417
|
|
|
|
|
|
|
|
5418
|
|
|
|
|
|
|
: see if _ptr and _cnt from stdio act std |
5419
|
|
|
|
|
|
|
echo " " |
5420
|
|
|
|
|
|
|
@@ -9567,6 +9651,32 @@ EOCP |
5421
|
|
|
|
|
|
|
esac |
5422
|
|
|
|
|
|
|
$rm -f try.c try |
5423
|
|
|
|
|
|
|
|
5424
|
|
|
|
|
|
|
+echo " " |
5425
|
|
|
|
|
|
|
+echo "Determining whether or not we are on an EBCDIC system..." >&4 |
5426
|
|
|
|
|
|
|
+$cat >tebcdic.c <
|
5427
|
|
|
|
|
|
|
+int main() |
5428
|
|
|
|
|
|
|
+{ |
5429
|
|
|
|
|
|
|
+ if ('M'==0xd4) return 0; |
5430
|
|
|
|
|
|
|
+ return 1; |
5431
|
|
|
|
|
|
|
+} |
5432
|
|
|
|
|
|
|
+EOM |
5433
|
|
|
|
|
|
|
+val=$undef |
5434
|
|
|
|
|
|
|
+set tebcdic |
5435
|
|
|
|
|
|
|
+if eval $compile_ok; then |
5436
|
|
|
|
|
|
|
+ if ./tebcdic; then |
5437
|
|
|
|
|
|
|
+ echo "You have EBCDIC." >&4 |
5438
|
|
|
|
|
|
|
+ val="$define" |
5439
|
|
|
|
|
|
|
+ else |
5440
|
|
|
|
|
|
|
+ echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4 |
5441
|
|
|
|
|
|
|
+ fi |
5442
|
|
|
|
|
|
|
+else |
5443
|
|
|
|
|
|
|
+ echo "I'm unable to compile the test program." >&4 |
5444
|
|
|
|
|
|
|
+ echo "I'll assume ASCII or some ISO Latin." >&4 |
5445
|
|
|
|
|
|
|
+fi |
5446
|
|
|
|
|
|
|
+$rm -f tebcdic.c tebcdic |
5447
|
|
|
|
|
|
|
+set ebcdic |
5448
|
|
|
|
|
|
|
+eval $setvar |
5449
|
|
|
|
|
|
|
+ |
5450
|
|
|
|
|
|
|
: see what type file positions are declared as in the library |
5451
|
|
|
|
|
|
|
rp="What is the type for file position used by fsetpos()?" |
5452
|
|
|
|
|
|
|
set fpos_t fpostype long stdio.h sys/types.h |
5453
|
|
|
|
|
|
|
@@ -10174,8 +10284,10 @@ EOM |
5454
|
|
|
|
|
|
|
: The first arg can be int, unsigned, or size_t |
5455
|
|
|
|
|
|
|
: The last arg may or may not be 'const' |
5456
|
|
|
|
|
|
|
val='' |
5457
|
|
|
|
|
|
|
+ : void pointer has been seen but using that |
5458
|
|
|
|
|
|
|
+ : breaks the selectminbits test |
5459
|
|
|
|
|
|
|
for xxx in 'fd_set *' 'int *'; do |
5460
|
|
|
|
|
|
|
- for nfd in 'int' 'size_t' 'unsigned' ; do |
5461
|
|
|
|
|
|
|
+ for nfd in 'int' 'size_t' 'unsigned' 'unsigned long'; do |
5462
|
|
|
|
|
|
|
for tmo in 'struct timeval *' 'const struct timeval *'; do |
5463
|
|
|
|
|
|
|
case "$val" in |
5464
|
|
|
|
|
|
|
'') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));" |
5465
|
|
|
|
|
|
|
@@ -10207,6 +10319,100 @@ EOM |
5466
|
|
|
|
|
|
|
;; |
5467
|
|
|
|
|
|
|
esac |
5468
|
|
|
|
|
|
|
|
5469
|
|
|
|
|
|
|
+: check for the select 'width' |
5470
|
|
|
|
|
|
|
+case "$selectminbits" in |
5471
|
|
|
|
|
|
|
+'') case "$d_select" in |
5472
|
|
|
|
|
|
|
+ $define) |
5473
|
|
|
|
|
|
|
+ $cat <
|
5474
|
|
|
|
|
|
|
+ |
5475
|
|
|
|
|
|
|
+Checking to see on how many bits at a time your select() operates... |
5476
|
|
|
|
|
|
|
+EOM |
5477
|
|
|
|
|
|
|
+ $cat >try.c <
|
5478
|
|
|
|
|
|
|
+#include |
5479
|
|
|
|
|
|
|
+#$i_time I_TIME |
5480
|
|
|
|
|
|
|
+#$i_systime I_SYS_TIME |
5481
|
|
|
|
|
|
|
+#$i_systimek I_SYS_TIME_KERNEL |
5482
|
|
|
|
|
|
|
+#ifdef I_TIME |
5483
|
|
|
|
|
|
|
+# include |
5484
|
|
|
|
|
|
|
+#endif |
5485
|
|
|
|
|
|
|
+#ifdef I_SYS_TIME |
5486
|
|
|
|
|
|
|
+# ifdef I_SYS_TIME_KERNEL |
5487
|
|
|
|
|
|
|
+# define KERNEL |
5488
|
|
|
|
|
|
|
+# endif |
5489
|
|
|
|
|
|
|
+# include |
5490
|
|
|
|
|
|
|
+# ifdef I_SYS_TIME_KERNEL |
5491
|
|
|
|
|
|
|
+# undef KERNEL |
5492
|
|
|
|
|
|
|
+# endif |
5493
|
|
|
|
|
|
|
+#endif |
5494
|
|
|
|
|
|
|
+#$i_sysselct I_SYS_SELECT |
5495
|
|
|
|
|
|
|
+#ifdef I_SYS_SELECT |
5496
|
|
|
|
|
|
|
+#include |
5497
|
|
|
|
|
|
|
+#endif |
5498
|
|
|
|
|
|
|
+#include |
5499
|
|
|
|
|
|
|
+$selecttype b; |
5500
|
|
|
|
|
|
|
+#define S sizeof(*(b)) |
5501
|
|
|
|
|
|
|
+#define MINBITS 64 |
5502
|
|
|
|
|
|
|
+#define NBYTES (S * 8 > MINBITS ? S : MINBITS/8) |
5503
|
|
|
|
|
|
|
+#define NBITS (NBYTES * 8) |
5504
|
|
|
|
|
|
|
+int main() { |
5505
|
|
|
|
|
|
|
+ char s[NBYTES]; |
5506
|
|
|
|
|
|
|
+ struct timeval t; |
5507
|
|
|
|
|
|
|
+ int i; |
5508
|
|
|
|
|
|
|
+ FILE* fp; |
5509
|
|
|
|
|
|
|
+ int fd; |
5510
|
|
|
|
|
|
|
+ |
5511
|
|
|
|
|
|
|
+ fclose(stdin); |
5512
|
|
|
|
|
|
|
+ fp = fopen("try.c", "r"); |
5513
|
|
|
|
|
|
|
+ if (fp == 0) |
5514
|
|
|
|
|
|
|
+ exit(1); |
5515
|
|
|
|
|
|
|
+ fd = fileno(fp); |
5516
|
|
|
|
|
|
|
+ if (fd < 0) |
5517
|
|
|
|
|
|
|
+ exit(2); |
5518
|
|
|
|
|
|
|
+ b = ($selecttype)s; |
5519
|
|
|
|
|
|
|
+ for (i = 0; i < NBITS; i++) |
5520
|
|
|
|
|
|
|
+ FD_SET(i, b); |
5521
|
|
|
|
|
|
|
+ t.tv_sec = 0; |
5522
|
|
|
|
|
|
|
+ t.tv_usec = 0; |
5523
|
|
|
|
|
|
|
+ select(fd + 1, b, 0, 0, &t); |
5524
|
|
|
|
|
|
|
+ for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--); |
5525
|
|
|
|
|
|
|
+ printf("%d\n", i + 1); |
5526
|
|
|
|
|
|
|
+ return 0; |
5527
|
|
|
|
|
|
|
+} |
5528
|
|
|
|
|
|
|
+EOCP |
5529
|
|
|
|
|
|
|
+ set try |
5530
|
|
|
|
|
|
|
+ if eval $compile_ok; then |
5531
|
|
|
|
|
|
|
+ selectminbits=`./try` |
5532
|
|
|
|
|
|
|
+ case "$selectminbits" in |
5533
|
|
|
|
|
|
|
+ '') cat >&4 <
|
5534
|
|
|
|
|
|
|
+Cannot figure out on how many bits at a time your select() operates. |
5535
|
|
|
|
|
|
|
+I'll play safe and guess it is 32 bits. |
5536
|
|
|
|
|
|
|
+EOM |
5537
|
|
|
|
|
|
|
+ selectminbits=32 |
5538
|
|
|
|
|
|
|
+ bits="32 bits" |
5539
|
|
|
|
|
|
|
+ ;; |
5540
|
|
|
|
|
|
|
+ 1) bits="1 bit" ;; |
5541
|
|
|
|
|
|
|
+ *) bits="$selectminbits bits" ;; |
5542
|
|
|
|
|
|
|
+ esac |
5543
|
|
|
|
|
|
|
+ echo "Your select() operates on $bits at a time." >&4 |
5544
|
|
|
|
|
|
|
+ else |
5545
|
|
|
|
|
|
|
+ rp='What is the minimum number of bits your select() operates on?' |
5546
|
|
|
|
|
|
|
+ case "$byteorder" in |
5547
|
|
|
|
|
|
|
+ 1234|12345678) dflt=32 ;; |
5548
|
|
|
|
|
|
|
+ *) dflt=1 ;; |
5549
|
|
|
|
|
|
|
+ esac |
5550
|
|
|
|
|
|
|
+ . ./myread |
5551
|
|
|
|
|
|
|
+ val=$ans |
5552
|
|
|
|
|
|
|
+ selectminbits="$val" |
5553
|
|
|
|
|
|
|
+ fi |
5554
|
|
|
|
|
|
|
+ $rm -f try.* try |
5555
|
|
|
|
|
|
|
+ ;; |
5556
|
|
|
|
|
|
|
+ *) : no select, so pick a harmless default |
5557
|
|
|
|
|
|
|
+ selectminbits='32' |
5558
|
|
|
|
|
|
|
+ ;; |
5559
|
|
|
|
|
|
|
+ esac |
5560
|
|
|
|
|
|
|
+ ;; |
5561
|
|
|
|
|
|
|
+esac |
5562
|
|
|
|
|
|
|
+ |
5563
|
|
|
|
|
|
|
: Trace out the files included by signal.h, then look for SIGxxx names. |
5564
|
|
|
|
|
|
|
: Remove SIGARRAYSIZE used by HPUX. |
5565
|
|
|
|
|
|
|
: Remove SIGTYP void lines used by OS2. |
5566
|
|
|
|
|
|
|
@@ -10415,7 +10621,13 @@ $eunicefix signal_cmd |
5567
|
|
|
|
|
|
|
: generate list of signal names |
5568
|
|
|
|
|
|
|
echo " " |
5569
|
|
|
|
|
|
|
case "$sig_name_init" in |
5570
|
|
|
|
|
|
|
-'') |
5571
|
|
|
|
|
|
|
+'') doinit=yes ;; |
5572
|
|
|
|
|
|
|
+*) case "$sig_num_init" in |
5573
|
|
|
|
|
|
|
+ ''|*,*) doinit=yes ;; |
5574
|
|
|
|
|
|
|
+ esac ;; |
5575
|
|
|
|
|
|
|
+esac |
5576
|
|
|
|
|
|
|
+case "$doinit" in |
5577
|
|
|
|
|
|
|
+yes) |
5578
|
|
|
|
|
|
|
echo "Generating a list of signal names and numbers..." >&4 |
5579
|
|
|
|
|
|
|
. ./signal_cmd |
5580
|
|
|
|
|
|
|
sig_name=`$awk '{printf "%s ", $1}' signal.lst` |
5581
|
|
|
|
|
|
|
@@ -10423,7 +10635,9 @@ case "$sig_name_init" in |
5582
|
|
|
|
|
|
|
sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " } |
5583
|
|
|
|
|
|
|
{ printf "\"%s\", ", $1 } |
5584
|
|
|
|
|
|
|
END { printf "0\n" }' signal.lst` |
5585
|
|
|
|
|
|
|
- sig_num=`$awk 'BEGIN { printf "0, " } |
5586
|
|
|
|
|
|
|
+ sig_num=`$awk '{printf "%d ", $2}' signal.lst` |
5587
|
|
|
|
|
|
|
+ sig_num="0 $sig_num" |
5588
|
|
|
|
|
|
|
+ sig_num_init=`$awk 'BEGIN { printf "0, " } |
5589
|
|
|
|
|
|
|
{ printf "%d, ", $2} |
5590
|
|
|
|
|
|
|
END { printf "0\n"}' signal.lst` |
5591
|
|
|
|
|
|
|
;; |
5592
|
|
|
|
|
|
|
@@ -10787,7 +11001,13 @@ $rm -f try.c |
5593
|
|
|
|
|
|
|
EOS |
5594
|
|
|
|
|
|
|
chmod +x ccsym |
5595
|
|
|
|
|
|
|
$eunicefix ccsym |
5596
|
|
|
|
|
|
|
-./ccsym | $sort | $uniq >ccsym.raw |
5597
|
|
|
|
|
|
|
+./ccsym > ccsym1.raw |
5598
|
|
|
|
|
|
|
+if $test -s ccsym1.raw; then |
5599
|
|
|
|
|
|
|
+ $sort ccsym1.raw | $uniq >ccsym.raw |
5600
|
|
|
|
|
|
|
+else |
5601
|
|
|
|
|
|
|
+ mv ccsym1.raw ccsym.raw |
5602
|
|
|
|
|
|
|
+fi |
5603
|
|
|
|
|
|
|
+ |
5604
|
|
|
|
|
|
|
$awk '/\=/ { print $0; next } |
5605
|
|
|
|
|
|
|
{ print $0"=1" }' ccsym.raw >ccsym.list |
5606
|
|
|
|
|
|
|
$awk '{ print $0"=1" }' Cppsym.true >ccsym.true |
5607
|
|
|
|
|
|
|
@@ -11012,10 +11232,6 @@ eval $inhdr |
5608
|
|
|
|
|
|
|
set sys/resource.h i_sysresrc |
5609
|
|
|
|
|
|
|
eval $inhdr |
5610
|
|
|
|
|
|
|
|
5611
|
|
|
|
|
|
|
-: see if sys/stat.h is available |
5612
|
|
|
|
|
|
|
-set sys/stat.h i_sysstat |
5613
|
|
|
|
|
|
|
-eval $inhdr |
5614
|
|
|
|
|
|
|
- |
5615
|
|
|
|
|
|
|
: see if this is a sys/un.h system |
5616
|
|
|
|
|
|
|
set sys/un.h i_sysun |
5617
|
|
|
|
|
|
|
eval $inhdr |
5618
|
|
|
|
|
|
|
@@ -11152,6 +11368,7 @@ for xxx in $known_extensions ; do |
5619
|
|
|
|
|
|
|
esac |
5620
|
|
|
|
|
|
|
;; |
5621
|
|
|
|
|
|
|
IPC/SysV|ipc/sysv) |
5622
|
|
|
|
|
|
|
+ : XXX Do we need a useipcsysv variable here |
5623
|
|
|
|
|
|
|
case "${d_msg}${d_sem}${d_shm}" in |
5624
|
|
|
|
|
|
|
*"${define}"*) avail_ext="$avail_ext $xxx" ;; |
5625
|
|
|
|
|
|
|
esac |
5626
|
|
|
|
|
|
|
@@ -11731,6 +11948,7 @@ i_values='$i_values' |
5627
|
|
|
|
|
|
|
i_varargs='$i_varargs' |
5628
|
|
|
|
|
|
|
i_varhdr='$i_varhdr' |
5629
|
|
|
|
|
|
|
i_vfork='$i_vfork' |
5630
|
|
|
|
|
|
|
+ignore_versioned_solibs='$ignore_versioned_solibs' |
5631
|
|
|
|
|
|
|
incpath='$incpath' |
5632
|
|
|
|
|
|
|
inews='$inews' |
5633
|
|
|
|
|
|
|
installarchlib='$installarchlib' |
5634
|
|
|
|
|
|
|
@@ -11839,6 +12057,7 @@ runnm='$runnm' |
5635
|
|
|
|
|
|
|
scriptdir='$scriptdir' |
5636
|
|
|
|
|
|
|
scriptdirexp='$scriptdirexp' |
5637
|
|
|
|
|
|
|
sed='$sed' |
5638
|
|
|
|
|
|
|
+selectminbits='$selectminbits' |
5639
|
|
|
|
|
|
|
selecttype='$selecttype' |
5640
|
|
|
|
|
|
|
sendmail='$sendmail' |
5641
|
|
|
|
|
|
|
sh='$sh' |
5642
|
|
|
|
|
|
|
@@ -11851,6 +12070,7 @@ shsharp='$shsharp' |
5643
|
|
|
|
|
|
|
sig_name='$sig_name' |
5644
|
|
|
|
|
|
|
sig_name_init='$sig_name_init' |
5645
|
|
|
|
|
|
|
sig_num='$sig_num' |
5646
|
|
|
|
|
|
|
+sig_num_init='$sig_num_init' |
5647
|
|
|
|
|
|
|
signal_t='$signal_t' |
5648
|
|
|
|
|
|
|
sitearch='$sitearch' |
5649
|
|
|
|
|
|
|
sitearchexp='$sitearchexp' |
5650
|
|
|
|
|
|
|
--- Makefile.SH |
5651
|
|
|
|
|
|
|
+++ Makefile.SH |
5652
|
|
|
|
|
|
|
@@ -644,3 +644,83 @@ case `pwd` in |
5653
|
|
|
|
|
|
|
;; |
5654
|
|
|
|
|
|
|
esac |
5655
|
|
|
|
|
|
|
$rm -f $firstmakefile |
5656
|
|
|
|
|
|
|
+ |
5657
|
|
|
|
|
|
|
+# Now do any special processing required before building. |
5658
|
|
|
|
|
|
|
+ |
5659
|
|
|
|
|
|
|
+case "$ebcdic" in |
5660
|
|
|
|
|
|
|
+$define) |
5661
|
|
|
|
|
|
|
+ xxx='' |
5662
|
|
|
|
|
|
|
+ echo "This is an EBCDIC system, checking if any parser files need regenerating." >&4 |
5663
|
|
|
|
|
|
|
+case "$osname" in |
5664
|
|
|
|
|
|
|
+os390) |
5665
|
|
|
|
|
|
|
+ rm -f y.tab.c y.tab.h |
5666
|
|
|
|
|
|
|
+ yacc -d perly.y >/dev/null 2>&1 |
5667
|
|
|
|
|
|
|
+ if cmp -s y.tab.c perly.c; then |
5668
|
|
|
|
|
|
|
+ rm -f y.tab.c |
5669
|
|
|
|
|
|
|
+ else |
5670
|
|
|
|
|
|
|
+ echo "perly.y -> perly.c" >&2 |
5671
|
|
|
|
|
|
|
+ mv -f y.tab.c perly.c |
5672
|
|
|
|
|
|
|
+ chmod u+w perly.c |
5673
|
|
|
|
|
|
|
+ sed -e '/^#include "perl\.h"/a\ |
5674
|
|
|
|
|
|
|
+\ |
5675
|
|
|
|
|
|
|
+#define yydebug PL_yydebug\ |
5676
|
|
|
|
|
|
|
+#define yynerrs PL_yynerrs\ |
5677
|
|
|
|
|
|
|
+#define yyerrflag PL_yyerrflag\ |
5678
|
|
|
|
|
|
|
+#define yychar PL_yychar\ |
5679
|
|
|
|
|
|
|
+#define yyval PL_yyval\ |
5680
|
|
|
|
|
|
|
+#define yylval PL_yylval' \ |
5681
|
|
|
|
|
|
|
+ -e '/YYSTYPE *yyval;/D' \ |
5682
|
|
|
|
|
|
|
+ -e '/YYSTYPE *yylval;/D' \ |
5683
|
|
|
|
|
|
|
+ -e '/int yychar,/,/yynerrs;/D' \ |
5684
|
|
|
|
|
|
|
+ -e 's/int yydebug = 0;/yydebug = 0;/' \ |
5685
|
|
|
|
|
|
|
+ -e 's/[^_]realloc(/PerlMem_realloc(/g' \ |
5686
|
|
|
|
|
|
|
+ -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ |
5687
|
|
|
|
|
|
|
+ -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c |
5688
|
|
|
|
|
|
|
+ xxx="$xxx perly.c" |
5689
|
|
|
|
|
|
|
+ fi |
5690
|
|
|
|
|
|
|
+ if cmp -s y.tab.h perly.h; then |
5691
|
|
|
|
|
|
|
+ rm -f y.tab.h |
5692
|
|
|
|
|
|
|
+ else |
5693
|
|
|
|
|
|
|
+ echo "perly.y -> perly.h" >&2 |
5694
|
|
|
|
|
|
|
+ mv -f y.tab.h perly.h |
5695
|
|
|
|
|
|
|
+ xxx="$xxx perly.h" |
5696
|
|
|
|
|
|
|
+ fi |
5697
|
|
|
|
|
|
|
+ if cd x2p |
5698
|
|
|
|
|
|
|
+ then |
5699
|
|
|
|
|
|
|
+ rm -f y.tab.c y.tab.h |
5700
|
|
|
|
|
|
|
+ yacc a2p.y >/dev/null 2>&1 |
5701
|
|
|
|
|
|
|
+ if cmp -s y.tab.c a2p.c |
5702
|
|
|
|
|
|
|
+ then |
5703
|
|
|
|
|
|
|
+ rm -f y.tab.c |
5704
|
|
|
|
|
|
|
+ else |
5705
|
|
|
|
|
|
|
+ echo "a2p.y -> a2p.c" >&2 |
5706
|
|
|
|
|
|
|
+ mv -f y.tab.c a2p.c |
5707
|
|
|
|
|
|
|
+ chmod u+w a2p.c |
5708
|
|
|
|
|
|
|
+ sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ |
5709
|
|
|
|
|
|
|
+ -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c |
5710
|
|
|
|
|
|
|
+ xxx="$xxx a2p.c" |
5711
|
|
|
|
|
|
|
+ fi |
5712
|
|
|
|
|
|
|
+ # In case somebody yacc -d:ed the a2p.y. |
5713
|
|
|
|
|
|
|
+ if test -f y.tab.h |
5714
|
|
|
|
|
|
|
+ then |
5715
|
|
|
|
|
|
|
+ if cmp -s y.tab.h a2p.h |
5716
|
|
|
|
|
|
|
+ then |
5717
|
|
|
|
|
|
|
+ rm -f y.tab.h |
5718
|
|
|
|
|
|
|
+ else |
5719
|
|
|
|
|
|
|
+ echo "a2p.h -> a2p.h" >&2 |
5720
|
|
|
|
|
|
|
+ mv -f y.tab.h a2p.h |
5721
|
|
|
|
|
|
|
+ xxx="$xxx a2p.h" |
5722
|
|
|
|
|
|
|
+ fi |
5723
|
|
|
|
|
|
|
+ fi |
5724
|
|
|
|
|
|
|
+ cd .. |
5725
|
|
|
|
|
|
|
+ fi |
5726
|
|
|
|
|
|
|
+ ;; |
5727
|
|
|
|
|
|
|
+*) |
5728
|
|
|
|
|
|
|
+ echo "'$osname' is an EBCDIC system I don't know that well." >&4 |
5729
|
|
|
|
|
|
|
+ ;; |
5730
|
|
|
|
|
|
|
+esac |
5731
|
|
|
|
|
|
|
+ case "$xxx" in |
5732
|
|
|
|
|
|
|
+ '') echo "No parser files were regenerated. That's okay." >&2 ;; |
5733
|
|
|
|
|
|
|
+ esac |
5734
|
|
|
|
|
|
|
+ ;; |
5735
|
|
|
|
|
|
|
+esac |
5736
|
|
|
|
|
|
|
--- config_h.SH |
5737
|
|
|
|
|
|
|
+++ config_h.SH |
5738
|
|
|
|
|
|
|
@@ -1813,7 +1813,7 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- |
5739
|
|
|
|
|
|
|
* the sig_name list. |
5740
|
|
|
|
|
|
|
*/ |
5741
|
|
|
|
|
|
|
#define SIG_NAME $sig_name_init /**/ |
5742
|
|
|
|
|
|
|
-#define SIG_NUM $sig_num /**/ |
5743
|
|
|
|
|
|
|
+#define SIG_NUM $sig_num_init /**/ |
5744
|
|
|
|
|
|
|
|
5745
|
|
|
|
|
|
|
/* VOIDFLAGS: |
5746
|
|
|
|
|
|
|
* This symbol indicates how much support of the void type is given by this |
5747
|
|
|
|
|
|
|
@@ -1902,6 +1902,15 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- |
5748
|
|
|
|
|
|
|
#define PRIVLIB "$privlib" /**/ |
5749
|
|
|
|
|
|
|
#define PRIVLIB_EXP "$privlibexp" /**/ |
5750
|
|
|
|
|
|
|
|
5751
|
|
|
|
|
|
|
+/* SELECT_MIN_BITS: |
5752
|
|
|
|
|
|
|
+ * This symbol holds the minimum number of bits operated by select. |
5753
|
|
|
|
|
|
|
+ * That is, if you do select(n, ...), how many bits at least will be |
5754
|
|
|
|
|
|
|
+ * cleared in the masks if some activity is detected. Usually this |
5755
|
|
|
|
|
|
|
+ * is either n or 32*ceil(n/32), especially many little-endians do |
5756
|
|
|
|
|
|
|
+ * the latter. This is only useful if you have select(), naturally. |
5757
|
|
|
|
|
|
|
+ */ |
5758
|
|
|
|
|
|
|
+#define SELECT_MIN_BITS $selectminbits /**/ |
5759
|
|
|
|
|
|
|
+ |
5760
|
|
|
|
|
|
|
/* SITEARCH: |
5761
|
|
|
|
|
|
|
* This symbol contains the name of the private library for this package. |
5762
|
|
|
|
|
|
|
* The library is private in the sense that it needn't be in anyone's |
5763
|
|
|
|
|
|
|
--- pp_sys.c |
5764
|
|
|
|
|
|
|
+++ pp_sys.c |
5765
|
|
|
|
|
|
|
@@ -56,7 +56,10 @@ extern "C" int syscall(unsigned long,...); |
5766
|
|
|
|
|
|
|
|
5767
|
|
|
|
|
|
|
/* XXX Configure test needed. |
5768
|
|
|
|
|
|
|
h_errno might not be a simple 'int', especially for multi-threaded |
5769
|
|
|
|
|
|
|
- applications. HOST_NOT_FOUND is typically defined in . |
5770
|
|
|
|
|
|
|
+ applications, see "extern int errno in perl.h". Creating such |
5771
|
|
|
|
|
|
|
+ a test requires taking into account the differences between |
5772
|
|
|
|
|
|
|
+ compiling multithreaded and singlethreaded ($ccflags et al). |
5773
|
|
|
|
|
|
|
+ HOST_NOT_FOUND is typically defined in . |
5774
|
|
|
|
|
|
|
*/ |
5775
|
|
|
|
|
|
|
#if defined(HOST_NOT_FOUND) && !defined(h_errno) |
5776
|
|
|
|
|
|
|
extern int h_errno; |
5777
|
|
|
|
|
|
|
@@ -753,12 +756,17 @@ PP(pp_sselect) |
5778
|
|
|
|
|
|
|
maxlen = j; |
5779
|
|
|
|
|
|
|
} |
5780
|
|
|
|
|
|
|
|
5781
|
|
|
|
|
|
|
+/* little endians can use vecs directly */ |
5782
|
|
|
|
|
|
|
#if BYTEORDER == 0x1234 || BYTEORDER == 0x12345678 |
5783
|
|
|
|
|
|
|
-/* XXX Configure test needed. */ |
5784
|
|
|
|
|
|
|
-#if defined(__linux__) || defined(OS2) || defined(NeXT) || defined(__osf__) |
5785
|
|
|
|
|
|
|
- growsize = sizeof(fd_set); |
5786
|
|
|
|
|
|
|
+# if SELECT_MIN_BITS > 1 |
5787
|
|
|
|
|
|
|
+ /* If SELECT_MIN_BITS is greater than one we most probably will want |
5788
|
|
|
|
|
|
|
+ * to align the sizes with SELECT_MIN_BITS/8 because for example |
5789
|
|
|
|
|
|
|
+ * in many little-endian (Intel, Alpha) systems (Linux, OS/2, Digital |
5790
|
|
|
|
|
|
|
+ * UNIX, Solaris, NeXT) the smallest quantum select() operates on |
5791
|
|
|
|
|
|
|
+ * (sets bit) is 32 bits. */ |
5792
|
|
|
|
|
|
|
+ growsize = maxlen + (SELECT_MIN_BITS/8 - (maxlen % (SELECT_MIN_BITS/8))); |
5793
|
|
|
|
|
|
|
#else |
5794
|
|
|
|
|
|
|
- growsize = maxlen; /* little endians can use vecs directly */ |
5795
|
|
|
|
|
|
|
+ growsize = sizeof(fd_set); |
5796
|
|
|
|
|
|
|
#endif |
5797
|
|
|
|
|
|
|
#else |
5798
|
|
|
|
|
|
|
#ifdef NFDBITS |
5799
|
|
|
|
|
|
|
END |
5800
|
|
|
|
|
|
|
} |
5801
|
|
|
|
|
|
|
|
5802
|
|
|
|
|
|
|
sub _patch_errno_gcc5 { |
5803
|
0
|
|
|
0
|
|
|
my $perlver = shift; |
5804
|
0
|
|
|
|
|
|
my $num = _norm_ver( $perlver ); |
5805
|
0
|
0
|
|
|
|
|
return unless $num < 5.021009; |
5806
|
0
|
0
|
0
|
|
|
|
return if $num > 5.020002 && $num < 5.021; |
5807
|
0
|
0
|
|
|
|
|
if ( $num < 5.006 ) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
5808
|
0
|
|
|
|
|
|
warn "The Errno GCC 5 patch only goes back as far as v5.6.0\n"; |
5809
|
0
|
|
|
|
|
|
warn "You will have to generate your own patch to go farther back\n"; |
5810
|
0
|
|
|
|
|
|
return; |
5811
|
|
|
|
|
|
|
} |
5812
|
|
|
|
|
|
|
elsif ( $num < 5.006001 ) { |
5813
|
0
|
|
|
|
|
|
_patch(<<'END'); |
5814
|
|
|
|
|
|
|
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL |
5815
|
|
|
|
|
|
|
index df68dc3..8385048 100644 |
5816
|
|
|
|
|
|
|
--- ext/Errno/Errno_pm.PL |
5817
|
|
|
|
|
|
|
+++ ext/Errno/Errno_pm.PL |
5818
|
|
|
|
|
|
|
@@ -143,16 +143,26 @@ sub write_errno_pm { |
5819
|
|
|
|
|
|
|
|
5820
|
|
|
|
|
|
|
# invoke CPP and read the output |
5821
|
|
|
|
|
|
|
|
5822
|
|
|
|
|
|
|
+ my $inhibit_linemarkers = ''; |
5823
|
|
|
|
|
|
|
+ if ($Config{gccversion} =~ /\A(\d+)\./ and $1 >= 5) { |
5824
|
|
|
|
|
|
|
+ # GCC 5.0 interleaves expanded macros with line numbers breaking |
5825
|
|
|
|
|
|
|
+ # each line into multiple lines. RT#123784 |
5826
|
|
|
|
|
|
|
+ $inhibit_linemarkers = ' -P'; |
5827
|
|
|
|
|
|
|
+ } |
5828
|
|
|
|
|
|
|
+ |
5829
|
|
|
|
|
|
|
if ($^O eq 'VMS') { |
5830
|
|
|
|
|
|
|
- my $cpp = "$Config{cppstdin} $Config{cppflags} $Config{cppminus}"; |
5831
|
|
|
|
|
|
|
+ my $cpp = "$Config{cppstdin} $Config{cppflags}" . |
5832
|
|
|
|
|
|
|
+ $inhibit_linemarkers . " $Config{cppminus}"; |
5833
|
|
|
|
|
|
|
$cpp =~ s/sys\$input//i; |
5834
|
|
|
|
|
|
|
open(CPPO,"$cpp errno.c |") or |
5835
|
|
|
|
|
|
|
die "Cannot exec $Config{cppstdin}"; |
5836
|
|
|
|
|
|
|
} elsif ($^O eq 'MSWin32') { |
5837
|
|
|
|
|
|
|
- open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or |
5838
|
|
|
|
|
|
|
- die "Cannot run '$Config{cpprun} $Config{cppflags} errno.c'"; |
5839
|
|
|
|
|
|
|
+ my $cpp = "$Config{cpprun} $Config{cppflags}" . |
5840
|
|
|
|
|
|
|
+ $inhibit_linemarkers; |
5841
|
|
|
|
|
|
|
+ open(CPPO,"$cpp errno.c |") or |
5842
|
|
|
|
|
|
|
+ die "Cannot run '$cpp errno.c'"; |
5843
|
|
|
|
|
|
|
} else { |
5844
|
|
|
|
|
|
|
- my $cpp = default_cpp(); |
5845
|
|
|
|
|
|
|
+ my $cpp = default_cpp() . $inhibit_linemarkers; |
5846
|
|
|
|
|
|
|
open(CPPO,"$cpp < errno.c |") |
5847
|
|
|
|
|
|
|
or die "Cannot exec $cpp"; |
5848
|
|
|
|
|
|
|
} |
5849
|
|
|
|
|
|
|
END |
5850
|
|
|
|
|
|
|
} |
5851
|
|
|
|
|
|
|
elsif ( $num < 5.007002 ) { # v5.6.0 et al |
5852
|
0
|
|
|
|
|
|
_patch(<<'END'); |
5853
|
|
|
|
|
|
|
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL |
5854
|
|
|
|
|
|
|
index 3f2f3e0..d8fe44e 100644 |
5855
|
|
|
|
|
|
|
--- ext/Errno/Errno_pm.PL |
5856
|
|
|
|
|
|
|
+++ ext/Errno/Errno_pm.PL |
5857
|
|
|
|
|
|
|
@@ -172,16 +172,26 @@ sub write_errno_pm { |
5858
|
|
|
|
|
|
|
unless ($^O eq 'MacOS') { # trust what we have |
5859
|
|
|
|
|
|
|
# invoke CPP and read the output |
5860
|
|
|
|
|
|
|
|
5861
|
|
|
|
|
|
|
+ my $inhibit_linemarkers = ''; |
5862
|
|
|
|
|
|
|
+ if ($Config{gccversion} =~ /\A(\d+)\./ and $1 >= 5) { |
5863
|
|
|
|
|
|
|
+ # GCC 5.0 interleaves expanded macros with line numbers breaking |
5864
|
|
|
|
|
|
|
+ # each line into multiple lines. RT#123784 |
5865
|
|
|
|
|
|
|
+ $inhibit_linemarkers = ' -P'; |
5866
|
|
|
|
|
|
|
+ } |
5867
|
|
|
|
|
|
|
+ |
5868
|
|
|
|
|
|
|
if ($^O eq 'VMS') { |
5869
|
|
|
|
|
|
|
- my $cpp = "$Config{cppstdin} $Config{cppflags} $Config{cppminus}"; |
5870
|
|
|
|
|
|
|
+ my $cpp = "$Config{cppstdin} $Config{cppflags}" . |
5871
|
|
|
|
|
|
|
+ $inhibit_linemarkers . " $Config{cppminus}"; |
5872
|
|
|
|
|
|
|
$cpp =~ s/sys\$input//i; |
5873
|
|
|
|
|
|
|
open(CPPO,"$cpp errno.c |") or |
5874
|
|
|
|
|
|
|
die "Cannot exec $Config{cppstdin}"; |
5875
|
|
|
|
|
|
|
} elsif ($^O eq 'MSWin32') { |
5876
|
|
|
|
|
|
|
- open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or |
5877
|
|
|
|
|
|
|
- die "Cannot run '$Config{cpprun} $Config{cppflags} errno.c'"; |
5878
|
|
|
|
|
|
|
+ my $cpp = "$Config{cpprun} $Config{cppflags}" . |
5879
|
|
|
|
|
|
|
+ $inhibit_linemarkers; |
5880
|
|
|
|
|
|
|
+ open(CPPO,"$cpp errno.c |") or |
5881
|
|
|
|
|
|
|
+ die "Cannot run '$cpp errno.c'"; |
5882
|
|
|
|
|
|
|
} else { |
5883
|
|
|
|
|
|
|
- my $cpp = default_cpp(); |
5884
|
|
|
|
|
|
|
+ my $cpp = default_cpp() . $inhibit_linemarkers; |
5885
|
|
|
|
|
|
|
open(CPPO,"$cpp < errno.c |") |
5886
|
|
|
|
|
|
|
or die "Cannot exec $cpp"; |
5887
|
|
|
|
|
|
|
} |
5888
|
|
|
|
|
|
|
END |
5889
|
|
|
|
|
|
|
} |
5890
|
|
|
|
|
|
|
elsif ( $num < 5.007003 ) { # v5.7.2 |
5891
|
0
|
|
|
|
|
|
_patch(<<'END'); |
5892
|
|
|
|
|
|
|
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL |
5893
|
|
|
|
|
|
|
index 3f2f3e0..d8fe44e 100644 |
5894
|
|
|
|
|
|
|
--- ext/Errno/Errno_pm.PL |
5895
|
|
|
|
|
|
|
+++ ext/Errno/Errno_pm.PL |
5896
|
|
|
|
|
|
|
@@ -172,16 +172,26 @@ sub write_errno_pm { |
5897
|
|
|
|
|
|
|
unless ($^O eq 'MacOS') { # trust what we have |
5898
|
|
|
|
|
|
|
# invoke CPP and read the output |
5899
|
|
|
|
|
|
|
|
5900
|
|
|
|
|
|
|
+ my $inhibit_linemarkers = ''; |
5901
|
|
|
|
|
|
|
+ if ($Config{gccversion} =~ /\A(\d+)\./ and $1 >= 5) { |
5902
|
|
|
|
|
|
|
+ # GCC 5.0 interleaves expanded macros with line numbers breaking |
5903
|
|
|
|
|
|
|
+ # each line into multiple lines. RT#123784 |
5904
|
|
|
|
|
|
|
+ $inhibit_linemarkers = ' -P'; |
5905
|
|
|
|
|
|
|
+ } |
5906
|
|
|
|
|
|
|
+ |
5907
|
|
|
|
|
|
|
if ($^O eq 'VMS') { |
5908
|
|
|
|
|
|
|
- my $cpp = "$Config{cppstdin} $Config{cppflags} $Config{cppminus}"; |
5909
|
|
|
|
|
|
|
+ my $cpp = "$Config{cppstdin} $Config{cppflags}" . |
5910
|
|
|
|
|
|
|
+ $inhibit_linemarkers . " $Config{cppminus}"; |
5911
|
|
|
|
|
|
|
$cpp =~ s/sys\$input//i; |
5912
|
|
|
|
|
|
|
open(CPPO,"$cpp errno.c |") or |
5913
|
|
|
|
|
|
|
die "Cannot exec $Config{cppstdin}"; |
5914
|
|
|
|
|
|
|
} elsif ($^O eq 'MSWin32' || $^O eq 'NetWare') { |
5915
|
|
|
|
|
|
|
- open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or |
5916
|
|
|
|
|
|
|
- die "Cannot run '$Config{cpprun} $Config{cppflags} errno.c'"; |
5917
|
|
|
|
|
|
|
+ my $cpp = "$Config{cpprun} $Config{cppflags}" . |
5918
|
|
|
|
|
|
|
+ $inhibit_linemarkers; |
5919
|
|
|
|
|
|
|
+ open(CPPO,"$cpp errno.c |") or |
5920
|
|
|
|
|
|
|
+ die "Cannot run '$cpp errno.c'"; |
5921
|
|
|
|
|
|
|
} else { |
5922
|
|
|
|
|
|
|
- my $cpp = default_cpp(); |
5923
|
|
|
|
|
|
|
+ my $cpp = default_cpp() . $inhibit_linemarkers; |
5924
|
|
|
|
|
|
|
open(CPPO,"$cpp < errno.c |") |
5925
|
|
|
|
|
|
|
or die "Cannot exec $cpp"; |
5926
|
|
|
|
|
|
|
} |
5927
|
|
|
|
|
|
|
END |
5928
|
|
|
|
|
|
|
} |
5929
|
|
|
|
|
|
|
elsif ( $num < 5.008009 ) { |
5930
|
0
|
|
|
|
|
|
_patch(<<'END'); |
5931
|
|
|
|
|
|
|
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL |
5932
|
|
|
|
|
|
|
index d8a0ab3..796e2f1 100644 |
5933
|
|
|
|
|
|
|
--- ext/Errno/Errno_pm.PL |
5934
|
|
|
|
|
|
|
+++ ext/Errno/Errno_pm.PL |
5935
|
|
|
|
|
|
|
@@ -235,16 +235,26 @@ sub write_errno_pm { |
5936
|
|
|
|
|
|
|
unless ($^O eq 'MacOS' || $^O eq 'beos') { # trust what we have / get later |
5937
|
|
|
|
|
|
|
# invoke CPP and read the output |
5938
|
|
|
|
|
|
|
|
5939
|
|
|
|
|
|
|
+ my $inhibit_linemarkers = ''; |
5940
|
|
|
|
|
|
|
+ if ($Config{gccversion} =~ /\A(\d+)\./ and $1 >= 5) { |
5941
|
|
|
|
|
|
|
+ # GCC 5.0 interleaves expanded macros with line numbers breaking |
5942
|
|
|
|
|
|
|
+ # each line into multiple lines. RT#123784 |
5943
|
|
|
|
|
|
|
+ $inhibit_linemarkers = ' -P'; |
5944
|
|
|
|
|
|
|
+ } |
5945
|
|
|
|
|
|
|
+ |
5946
|
|
|
|
|
|
|
if ($^O eq 'VMS') { |
5947
|
|
|
|
|
|
|
- my $cpp = "$Config{cppstdin} $Config{cppflags} $Config{cppminus}"; |
5948
|
|
|
|
|
|
|
+ my $cpp = "$Config{cppstdin} $Config{cppflags}" . |
5949
|
|
|
|
|
|
|
+ $inhibit_linemarkers . " $Config{cppminus}"; |
5950
|
|
|
|
|
|
|
$cpp =~ s/sys\$input//i; |
5951
|
|
|
|
|
|
|
open(CPPO,"$cpp errno.c |") or |
5952
|
|
|
|
|
|
|
die "Cannot exec $Config{cppstdin}"; |
5953
|
|
|
|
|
|
|
} elsif ($^O eq 'MSWin32' || $^O eq 'NetWare') { |
5954
|
|
|
|
|
|
|
- open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or |
5955
|
|
|
|
|
|
|
- die "Cannot run '$Config{cpprun} $Config{cppflags} errno.c'"; |
5956
|
|
|
|
|
|
|
+ my $cpp = "$Config{cpprun} $Config{cppflags}" . |
5957
|
|
|
|
|
|
|
+ $inhibit_linemarkers; |
5958
|
|
|
|
|
|
|
+ open(CPPO,"$cpp errno.c |") or |
5959
|
|
|
|
|
|
|
+ die "Cannot run '$cpp errno.c'"; |
5960
|
|
|
|
|
|
|
} else { |
5961
|
|
|
|
|
|
|
- my $cpp = default_cpp(); |
5962
|
|
|
|
|
|
|
+ my $cpp = default_cpp() . $inhibit_linemarkers; |
5963
|
|
|
|
|
|
|
open(CPPO,"$cpp < errno.c |") |
5964
|
|
|
|
|
|
|
or die "Cannot exec $cpp"; |
5965
|
|
|
|
|
|
|
} |
5966
|
|
|
|
|
|
|
END |
5967
|
|
|
|
|
|
|
} |
5968
|
|
|
|
|
|
|
else { |
5969
|
0
|
|
|
|
|
|
_patch(<<'END'); |
5970
|
|
|
|
|
|
|
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL |
5971
|
|
|
|
|
|
|
index 3dadfce..c6bfa06 100644 |
5972
|
|
|
|
|
|
|
--- ext/Errno/Errno_pm.PL |
5973
|
|
|
|
|
|
|
+++ ext/Errno/Errno_pm.PL |
5974
|
|
|
|
|
|
|
@@ -215,20 +215,31 @@ sub write_errno_pm { |
5975
|
|
|
|
|
|
|
{ # BeOS (support now removed) did not enter this block |
5976
|
|
|
|
|
|
|
# invoke CPP and read the output |
5977
|
|
|
|
|
|
|
|
5978
|
|
|
|
|
|
|
+ my $inhibit_linemarkers = ''; |
5979
|
|
|
|
|
|
|
+ if ($Config{gccversion} =~ /\A(\d+)\./ and $1 >= 5) { |
5980
|
|
|
|
|
|
|
+ # GCC 5.0 interleaves expanded macros with line numbers breaking |
5981
|
|
|
|
|
|
|
+ # each line into multiple lines. RT#123784 |
5982
|
|
|
|
|
|
|
+ $inhibit_linemarkers = ' -P'; |
5983
|
|
|
|
|
|
|
+ } |
5984
|
|
|
|
|
|
|
+ |
5985
|
|
|
|
|
|
|
if ($^O eq 'VMS') { |
5986
|
|
|
|
|
|
|
- my $cpp = "$Config{cppstdin} $Config{cppflags} $Config{cppminus}"; |
5987
|
|
|
|
|
|
|
+ my $cpp = "$Config{cppstdin} $Config{cppflags}" . |
5988
|
|
|
|
|
|
|
+ $inhibit_linemarkers . " $Config{cppminus}"; |
5989
|
|
|
|
|
|
|
$cpp =~ s/sys\$input//i; |
5990
|
|
|
|
|
|
|
open(CPPO,"$cpp errno.c |") or |
5991
|
|
|
|
|
|
|
die "Cannot exec $Config{cppstdin}"; |
5992
|
|
|
|
|
|
|
} elsif ($IsMSWin32 || $^O eq 'NetWare') { |
5993
|
|
|
|
|
|
|
- open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or |
5994
|
|
|
|
|
|
|
- die "Cannot run '$Config{cpprun} $Config{cppflags} errno.c'"; |
5995
|
|
|
|
|
|
|
+ my $cpp = "$Config{cpprun} $Config{cppflags}" . |
5996
|
|
|
|
|
|
|
+ $inhibit_linemarkers; |
5997
|
|
|
|
|
|
|
+ open(CPPO,"$cpp errno.c |") or |
5998
|
|
|
|
|
|
|
+ die "Cannot run '$cpp errno.c'"; |
5999
|
|
|
|
|
|
|
} elsif ($IsSymbian) { |
6000
|
|
|
|
|
|
|
- my $cpp = "gcc -E -I$ENV{SDK}\\epoc32\\include\\libc -"; |
6001
|
|
|
|
|
|
|
+ my $cpp = "gcc -E -I$ENV{SDK}\\epoc32\\include\\libc" . |
6002
|
|
|
|
|
|
|
+ $inhibit_linemarkers ." -"; |
6003
|
|
|
|
|
|
|
open(CPPO,"$cpp < errno.c |") |
6004
|
|
|
|
|
|
|
or die "Cannot exec $cpp"; |
6005
|
|
|
|
|
|
|
} else { |
6006
|
|
|
|
|
|
|
- my $cpp = default_cpp(); |
6007
|
|
|
|
|
|
|
+ my $cpp = default_cpp() . $inhibit_linemarkers; |
6008
|
|
|
|
|
|
|
open(CPPO,"$cpp < errno.c |") |
6009
|
|
|
|
|
|
|
or die "Cannot exec $cpp"; |
6010
|
|
|
|
|
|
|
} |
6011
|
|
|
|
|
|
|
END |
6012
|
|
|
|
|
|
|
} |
6013
|
|
|
|
|
|
|
} |
6014
|
|
|
|
|
|
|
|
6015
|
|
|
|
|
|
|
sub _patch_time_hires { |
6016
|
0
|
|
|
0
|
|
|
_patch(<<'END'); |
6017
|
|
|
|
|
|
|
diff --git a/dist/Time-HiRes/HiRes.pm b/dist/Time-HiRes/HiRes.pm |
6018
|
|
|
|
|
|
|
index ad9a65c99d..a3ddd595b7 100644 |
6019
|
|
|
|
|
|
|
--- dist/Time-HiRes/HiRes.pm |
6020
|
|
|
|
|
|
|
+++ dist/Time-HiRes/HiRes.pm |
6021
|
|
|
|
|
|
|
@@ -23,12 +23,12 @@ our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval |
6022
|
|
|
|
|
|
|
ITIMER_REAL ITIMER_VIRTUAL ITIMER_PROF ITIMER_REALPROF |
6023
|
|
|
|
|
|
|
TIMER_ABSTIME |
6024
|
|
|
|
|
|
|
d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer |
6025
|
|
|
|
|
|
|
- d_nanosleep d_clock_gettime d_clock_getres |
6026
|
|
|
|
|
|
|
+ d_nanosleep d_clock_gettime d_clock_getres d_hires_utime |
6027
|
|
|
|
|
|
|
d_clock d_clock_nanosleep |
6028
|
|
|
|
|
|
|
- stat lstat |
6029
|
|
|
|
|
|
|
+ stat lstat utime |
6030
|
|
|
|
|
|
|
); |
6031
|
|
|
|
|
|
|
|
6032
|
|
|
|
|
|
|
-our $VERSION = '1.9733'; |
6033
|
|
|
|
|
|
|
+our $VERSION = '1.9741'; |
6034
|
|
|
|
|
|
|
our $XS_VERSION = $VERSION; |
6035
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
6036
|
|
|
|
|
|
|
|
6037
|
|
|
|
|
|
|
@@ -60,6 +60,7 @@ sub import { |
6038
|
|
|
|
|
|
|
($i eq 'clock' && !&d_clock) || |
6039
|
|
|
|
|
|
|
($i eq 'nanosleep' && !&d_nanosleep) || |
6040
|
|
|
|
|
|
|
($i eq 'usleep' && !&d_usleep) || |
6041
|
|
|
|
|
|
|
+ ($i eq 'utime' && !&d_hires_utime) || |
6042
|
|
|
|
|
|
|
($i eq 'ualarm' && !&d_ualarm)) { |
6043
|
|
|
|
|
|
|
require Carp; |
6044
|
|
|
|
|
|
|
Carp::croak("Time::HiRes::$i(): unimplemented in this platform"); |
6045
|
|
|
|
|
|
|
@@ -92,7 +93,7 @@ Time::HiRes - High resolution alarm, sleep, gettimeofday, interval timers |
6046
|
|
|
|
|
|
|
|
6047
|
|
|
|
|
|
|
use Time::HiRes qw( usleep ualarm gettimeofday tv_interval nanosleep |
6048
|
|
|
|
|
|
|
clock_gettime clock_getres clock_nanosleep clock |
6049
|
|
|
|
|
|
|
- stat lstat ); |
6050
|
|
|
|
|
|
|
+ stat lstat utime); |
6051
|
|
|
|
|
|
|
|
6052
|
|
|
|
|
|
|
usleep ($microseconds); |
6053
|
|
|
|
|
|
|
nanosleep ($nanoseconds); |
6054
|
|
|
|
|
|
|
@@ -137,6 +138,9 @@ Time::HiRes - High resolution alarm, sleep, gettimeofday, interval timers |
6055
|
|
|
|
|
|
|
my @stat = stat(FH); |
6056
|
|
|
|
|
|
|
my @stat = lstat("file"); |
6057
|
|
|
|
|
|
|
|
6058
|
|
|
|
|
|
|
+ use Time::HiRes qw( utime ); |
6059
|
|
|
|
|
|
|
+ utime $floating_seconds, $floating_seconds, file...; |
6060
|
|
|
|
|
|
|
+ |
6061
|
|
|
|
|
|
|
=head1 DESCRIPTION |
6062
|
|
|
|
|
|
|
|
6063
|
|
|
|
|
|
|
The C module implements a Perl interface to the |
6064
|
|
|
|
|
|
|
@@ -446,6 +450,26 @@ if the operations are |
6065
|
|
|
|
|
|
|
the access time stamp from t2 need not be greater-than the modify |
6066
|
|
|
|
|
|
|
time stamp from t1: it may be equal or I. |
6067
|
|
|
|
|
|
|
|
6068
|
|
|
|
|
|
|
+=item utime LIST |
6069
|
|
|
|
|
|
|
+ |
6070
|
|
|
|
|
|
|
+As L |
6071
|
|
|
|
|
|
|
+but with the ability to set the access/modify file timestamps |
6072
|
|
|
|
|
|
|
+in subsecond resolution, if the operating system and the filesystem |
6073
|
|
|
|
|
|
|
+both support such timestamps. To override the standard utime(): |
6074
|
|
|
|
|
|
|
+ |
6075
|
|
|
|
|
|
|
+ use Time::HiRes qw(utime); |
6076
|
|
|
|
|
|
|
+ |
6077
|
|
|
|
|
|
|
+Test for the value of &Time::HiRes::d_hires_utime to find out whether |
6078
|
|
|
|
|
|
|
+the operating system supports setting subsecond file timestamps. |
6079
|
|
|
|
|
|
|
+ |
6080
|
|
|
|
|
|
|
+As with CORE::utime(), passing undef as both the atime and mtime will |
6081
|
|
|
|
|
|
|
+call the syscall with a NULL argument. |
6082
|
|
|
|
|
|
|
+ |
6083
|
|
|
|
|
|
|
+The actual achievable subsecond resolution depends on the combination |
6084
|
|
|
|
|
|
|
+of the operating system and the filesystem. |
6085
|
|
|
|
|
|
|
+ |
6086
|
|
|
|
|
|
|
+Returns the number of files successfully changed. |
6087
|
|
|
|
|
|
|
+ |
6088
|
|
|
|
|
|
|
=back |
6089
|
|
|
|
|
|
|
|
6090
|
|
|
|
|
|
|
=head1 EXAMPLES |
6091
|
|
|
|
|
|
|
@@ -535,7 +559,7 @@ VMS have emulations for it.) |
6092
|
|
|
|
|
|
|
Here is an example of using C from C: |
6093
|
|
|
|
|
|
|
|
6094
|
|
|
|
|
|
|
NV (*myNVtime)(); /* Returns -1 on failure. */ |
6095
|
|
|
|
|
|
|
- SV **svp = hv_fetch(PL_modglobal, "Time::NVtime", 12, 0); |
6096
|
|
|
|
|
|
|
+ SV **svp = hv_fetchs(PL_modglobal, "Time::NVtime", 0); |
6097
|
|
|
|
|
|
|
if (!svp) croak("Time::HiRes is required"); |
6098
|
|
|
|
|
|
|
if (!SvIOK(*svp)) croak("Time::NVtime isn't a function pointer"); |
6099
|
|
|
|
|
|
|
myNVtime = INT2PTR(NV(*)(), SvIV(*svp)); |
6100
|
|
|
|
|
|
|
@@ -586,9 +610,13 @@ might help in this (in case your system supports CLOCK_MONOTONIC). |
6101
|
|
|
|
|
|
|
Some systems have APIs but not implementations: for example QNX and Haiku |
6102
|
|
|
|
|
|
|
have the interval timer APIs but not the functionality. |
6103
|
|
|
|
|
|
|
|
6104
|
|
|
|
|
|
|
-In OS X clock_getres(), clock_gettime() and clock_nanosleep() are |
6105
|
|
|
|
|
|
|
-emulated using the Mach timers; as a side effect of being emulated |
6106
|
|
|
|
|
|
|
-the CLOCK_REALTIME and CLOCK_MONOTONIC are the same timer. |
6107
|
|
|
|
|
|
|
+In pre-Sierra macOS (pre-10.12, OS X) clock_getres(), clock_gettime() |
6108
|
|
|
|
|
|
|
+and clock_nanosleep() are emulated using the Mach timers; as a side |
6109
|
|
|
|
|
|
|
+effect of being emulated the CLOCK_REALTIME and CLOCK_MONOTONIC are |
6110
|
|
|
|
|
|
|
+the same timer. |
6111
|
|
|
|
|
|
|
+ |
6112
|
|
|
|
|
|
|
+gnukfreebsd seems to have non-functional futimens() and utimensat() |
6113
|
|
|
|
|
|
|
+(at least as of 10.1): therefore the hires utime() does not work. |
6114
|
|
|
|
|
|
|
|
6115
|
|
|
|
|
|
|
=head1 SEE ALSO |
6116
|
|
|
|
|
|
|
|
6117
|
|
|
|
|
|
|
diff --git a/dist/Time-HiRes/HiRes.xs b/dist/Time-HiRes/HiRes.xs |
6118
|
|
|
|
|
|
|
index 38ca0dc320..6b0dba8e68 100644 |
6119
|
|
|
|
|
|
|
--- dist/Time-HiRes/HiRes.xs |
6120
|
|
|
|
|
|
|
+++ dist/Time-HiRes/HiRes.xs |
6121
|
|
|
|
|
|
|
@@ -87,6 +87,10 @@ extern "C" { |
6122
|
|
|
|
|
|
|
# undef ITIMER_REALPROF |
6123
|
|
|
|
|
|
|
#endif |
6124
|
|
|
|
|
|
|
|
6125
|
|
|
|
|
|
|
+#ifndef TIME_HIRES_CLOCKID_T |
6126
|
|
|
|
|
|
|
+typedef int clockid_t; |
6127
|
|
|
|
|
|
|
+#endif |
6128
|
|
|
|
|
|
|
+ |
6129
|
|
|
|
|
|
|
#if defined(TIME_HIRES_CLOCK_GETTIME) && defined(_STRUCT_ITIMERSPEC) |
6130
|
|
|
|
|
|
|
|
6131
|
|
|
|
|
|
|
/* HP-UX has CLOCK_XXX values but as enums, not as defines. |
6132
|
|
|
|
|
|
|
@@ -747,21 +751,33 @@ hrstatns(UV *atime_nsec, UV *mtime_nsec, UV *ctime_nsec) |
6133
|
|
|
|
|
|
|
#endif /* !TIME_HIRES_STAT */ |
6134
|
|
|
|
|
|
|
} |
6135
|
|
|
|
|
|
|
|
6136
|
|
|
|
|
|
|
-/* Until Apple implements clock_gettime() (ditto clock_getres()) |
6137
|
|
|
|
|
|
|
- * we will emulate it using Mach interfaces. */ |
6138
|
|
|
|
|
|
|
-#if defined(PERL_DARWIN) && !defined(CLOCK_REALTIME) |
6139
|
|
|
|
|
|
|
- |
6140
|
|
|
|
|
|
|
-# include |
6141
|
|
|
|
|
|
|
+/* Until Apple implements clock_gettime() |
6142
|
|
|
|
|
|
|
+ * (ditto clock_getres() and clock_nanosleep()) |
6143
|
|
|
|
|
|
|
+ * we will emulate them using the Mach kernel interfaces. */ |
6144
|
|
|
|
|
|
|
+#if defined(PERL_DARWIN) && \ |
6145
|
|
|
|
|
|
|
+ (defined(TIME_HIRES_CLOCK_GETTIME_EMULATION) || \ |
6146
|
|
|
|
|
|
|
+ defined(TIME_HIRES_CLOCK_GETRES_EMULATION) || \ |
6147
|
|
|
|
|
|
|
+ defined(TIME_HIRES_CLOCK_NANOSLEEP_EMULATION)) |
6148
|
|
|
|
|
|
|
|
6149
|
|
|
|
|
|
|
+#ifndef CLOCK_REALTIME |
6150
|
|
|
|
|
|
|
# define CLOCK_REALTIME 0x01 |
6151
|
|
|
|
|
|
|
# define CLOCK_MONOTONIC 0x02 |
6152
|
|
|
|
|
|
|
+#endif |
6153
|
|
|
|
|
|
|
|
6154
|
|
|
|
|
|
|
+#ifndef TIMER_ABSTIME |
6155
|
|
|
|
|
|
|
# define TIMER_ABSTIME 0x01 |
6156
|
|
|
|
|
|
|
+#endif |
6157
|
|
|
|
|
|
|
|
6158
|
|
|
|
|
|
|
#ifdef USE_ITHREADS |
6159
|
|
|
|
|
|
|
+# define PERL_DARWIN_MUTEX |
6160
|
|
|
|
|
|
|
+#endif |
6161
|
|
|
|
|
|
|
+ |
6162
|
|
|
|
|
|
|
+#ifdef PERL_DARWIN_MUTEX |
6163
|
|
|
|
|
|
|
STATIC perl_mutex darwin_time_mutex; |
6164
|
|
|
|
|
|
|
#endif |
6165
|
|
|
|
|
|
|
|
6166
|
|
|
|
|
|
|
+#include |
6167
|
|
|
|
|
|
|
+ |
6168
|
|
|
|
|
|
|
static uint64_t absolute_time_init; |
6169
|
|
|
|
|
|
|
static mach_timebase_info_data_t timebase_info; |
6170
|
|
|
|
|
|
|
static struct timespec timespec_init; |
6171
|
|
|
|
|
|
|
@@ -769,7 +785,7 @@ static struct timespec timespec_init; |
6172
|
|
|
|
|
|
|
static int darwin_time_init() { |
6173
|
|
|
|
|
|
|
struct timeval tv; |
6174
|
|
|
|
|
|
|
int success = 1; |
6175
|
|
|
|
|
|
|
-#ifdef USE_ITHREADS |
6176
|
|
|
|
|
|
|
+#ifdef PERL_DARWIN_MUTEX |
6177
|
|
|
|
|
|
|
MUTEX_LOCK(&darwin_time_mutex); |
6178
|
|
|
|
|
|
|
#endif |
6179
|
|
|
|
|
|
|
if (absolute_time_init == 0) { |
6180
|
|
|
|
|
|
|
@@ -784,13 +800,14 @@ static int darwin_time_init() { |
6181
|
|
|
|
|
|
|
} |
6182
|
|
|
|
|
|
|
} |
6183
|
|
|
|
|
|
|
} |
6184
|
|
|
|
|
|
|
-#ifdef USE_ITHREADS |
6185
|
|
|
|
|
|
|
+#ifdef PERL_DARWIN_MUTEX |
6186
|
|
|
|
|
|
|
MUTEX_UNLOCK(&darwin_time_mutex); |
6187
|
|
|
|
|
|
|
#endif |
6188
|
|
|
|
|
|
|
return success; |
6189
|
|
|
|
|
|
|
} |
6190
|
|
|
|
|
|
|
|
6191
|
|
|
|
|
|
|
-static int clock_gettime(int clock_id, struct timespec *ts) { |
6192
|
|
|
|
|
|
|
+#ifdef TIME_HIRES_CLOCK_GETTIME_EMULATION |
6193
|
|
|
|
|
|
|
+static int th_clock_gettime(clockid_t clock_id, struct timespec *ts) { |
6194
|
|
|
|
|
|
|
if (darwin_time_init() && timebase_info.denom) { |
6195
|
|
|
|
|
|
|
switch (clock_id) { |
6196
|
|
|
|
|
|
|
case CLOCK_REALTIME: |
6197
|
|
|
|
|
|
|
@@ -822,7 +839,12 @@ static int clock_gettime(int clock_id, struct timespec *ts) { |
6198
|
|
|
|
|
|
|
return -1; |
6199
|
|
|
|
|
|
|
} |
6200
|
|
|
|
|
|
|
|
6201
|
|
|
|
|
|
|
-static int clock_getres(int clock_id, struct timespec *ts) { |
6202
|
|
|
|
|
|
|
+#define clock_gettime(clock_id, ts) th_clock_gettime((clock_id), (ts)) |
6203
|
|
|
|
|
|
|
+ |
6204
|
|
|
|
|
|
|
+#endif /* TIME_HIRES_CLOCK_GETTIME_EMULATION */ |
6205
|
|
|
|
|
|
|
+ |
6206
|
|
|
|
|
|
|
+#ifdef TIME_HIRES_CLOCK_GETRES_EMULATION |
6207
|
|
|
|
|
|
|
+static int th_clock_getres(clockid_t clock_id, struct timespec *ts) { |
6208
|
|
|
|
|
|
|
if (darwin_time_init() && timebase_info.denom) { |
6209
|
|
|
|
|
|
|
switch (clock_id) { |
6210
|
|
|
|
|
|
|
case CLOCK_REALTIME: |
6211
|
|
|
|
|
|
|
@@ -842,7 +864,11 @@ static int clock_getres(int clock_id, struct timespec *ts) { |
6212
|
|
|
|
|
|
|
return -1; |
6213
|
|
|
|
|
|
|
} |
6214
|
|
|
|
|
|
|
|
6215
|
|
|
|
|
|
|
-static int clock_nanosleep(int clock_id, int flags, |
6216
|
|
|
|
|
|
|
+#define clock_getres(clock_id, ts) th_clock_getres((clock_id), (ts)) |
6217
|
|
|
|
|
|
|
+#endif /* TIME_HIRES_CLOCK_GETRES_EMULATION */ |
6218
|
|
|
|
|
|
|
+ |
6219
|
|
|
|
|
|
|
+#ifdef TIME_HIRES_CLOCK_NANOSLEEP_EMULATION |
6220
|
|
|
|
|
|
|
+static int th_clock_nanosleep(clockid_t clock_id, int flags, |
6221
|
|
|
|
|
|
|
const struct timespec *rqtp, |
6222
|
|
|
|
|
|
|
struct timespec *rmtp) { |
6223
|
|
|
|
|
|
|
if (darwin_time_init()) { |
6224
|
|
|
|
|
|
|
@@ -880,6 +906,11 @@ static int clock_nanosleep(int clock_id, int flags, |
6225
|
|
|
|
|
|
|
return -1; |
6226
|
|
|
|
|
|
|
} |
6227
|
|
|
|
|
|
|
|
6228
|
|
|
|
|
|
|
+#define clock_nanosleep(clock_id, flags, rqtp, rmtp) \ |
6229
|
|
|
|
|
|
|
+ th_clock_nanosleep((clock_id), (flags), (rqtp), (rmtp)) |
6230
|
|
|
|
|
|
|
+ |
6231
|
|
|
|
|
|
|
+#endif /* TIME_HIRES_CLOCK_NANOSLEEP_EMULATION */ |
6232
|
|
|
|
|
|
|
+ |
6233
|
|
|
|
|
|
|
#endif /* PERL_DARWIN */ |
6234
|
|
|
|
|
|
|
|
6235
|
|
|
|
|
|
|
#include "const-c.inc" |
6236
|
|
|
|
|
|
|
@@ -921,6 +952,22 @@ nsec_without_unslept(struct timespec *sleepfor, |
6237
|
|
|
|
|
|
|
|
6238
|
|
|
|
|
|
|
#endif |
6239
|
|
|
|
|
|
|
|
6240
|
|
|
|
|
|
|
+/* In case Perl and/or Devel::PPPort are too old, minimally emulate |
6241
|
|
|
|
|
|
|
+ * IS_SAFE_PATHNAME() (which looks for zero bytes in the pathname). */ |
6242
|
|
|
|
|
|
|
+#ifndef IS_SAFE_PATHNAME |
6243
|
|
|
|
|
|
|
+#if PERL_VERSION >= 12 /* Perl_ck_warner is 5.10.0 -> */ |
6244
|
|
|
|
|
|
|
+#ifdef WARN_SYSCALLS |
6245
|
|
|
|
|
|
|
+#define WARNEMUCAT WARN_SYSCALLS /* 5.22.0 -> */ |
6246
|
|
|
|
|
|
|
+#else |
6247
|
|
|
|
|
|
|
+#define WARNEMUCAT WARN_MISC |
6248
|
|
|
|
|
|
|
+#endif |
6249
|
|
|
|
|
|
|
+#define WARNEMU(opname) Perl_ck_warner(aTHX_ packWARN(WARNEMUCAT), "Invalid \\0 character in pathname for %s",opname) |
6250
|
|
|
|
|
|
|
+#else |
6251
|
|
|
|
|
|
|
+#define WARNEMU(opname) Perl_warn(aTHX_ "Invalid \\0 character in pathname for %s",opname) |
6252
|
|
|
|
|
|
|
+#endif |
6253
|
|
|
|
|
|
|
+#define IS_SAFE_PATHNAME(pv, len, opname) (((len)>1)&&memchr((pv), 0, (len)-1)?(SETERRNO(ENOENT, LIB_INVARG),WARNEMU(opname),FALSE):(TRUE)) |
6254
|
|
|
|
|
|
|
+#endif |
6255
|
|
|
|
|
|
|
+ |
6256
|
|
|
|
|
|
|
MODULE = Time::HiRes PACKAGE = Time::HiRes |
6257
|
|
|
|
|
|
|
|
6258
|
|
|
|
|
|
|
PROTOTYPES: ENABLE |
6259
|
|
|
|
|
|
|
@@ -941,7 +988,7 @@ BOOT: |
6260
|
|
|
|
|
|
|
# endif |
6261
|
|
|
|
|
|
|
#endif |
6262
|
|
|
|
|
|
|
#if defined(PERL_DARWIN) |
6263
|
|
|
|
|
|
|
-# ifdef USE_ITHREADS |
6264
|
|
|
|
|
|
|
+# if defined(USE_ITHREADS) && defined(PERL_DARWIN_MUTEX) |
6265
|
|
|
|
|
|
|
MUTEX_INIT(&darwin_time_mutex); |
6266
|
|
|
|
|
|
|
# endif |
6267
|
|
|
|
|
|
|
#endif |
6268
|
|
|
|
|
|
|
@@ -978,7 +1025,8 @@ usleep(useconds) |
6269
|
|
|
|
|
|
|
useconds -= NV_1E6 * seconds; |
6270
|
|
|
|
|
|
|
} |
6271
|
|
|
|
|
|
|
} else if (useconds < 0.0) |
6272
|
|
|
|
|
|
|
- croak("Time::HiRes::usleep(%"NVgf"): negative time not invented yet", useconds); |
6273
|
|
|
|
|
|
|
+ croak("Time::HiRes::usleep(%" NVgf |
6274
|
|
|
|
|
|
|
+ "): negative time not invented yet", useconds); |
6275
|
|
|
|
|
|
|
usleep((U32)useconds); |
6276
|
|
|
|
|
|
|
} else |
6277
|
|
|
|
|
|
|
PerlProc_pause(); |
6278
|
|
|
|
|
|
|
@@ -1000,7 +1048,8 @@ nanosleep(nsec) |
6279
|
|
|
|
|
|
|
struct timespec sleepfor, unslept; |
6280
|
|
|
|
|
|
|
CODE: |
6281
|
|
|
|
|
|
|
if (nsec < 0.0) |
6282
|
|
|
|
|
|
|
- croak("Time::HiRes::nanosleep(%"NVgf"): negative time not invented yet", nsec); |
6283
|
|
|
|
|
|
|
+ croak("Time::HiRes::nanosleep(%" NVgf |
6284
|
|
|
|
|
|
|
+ "): negative time not invented yet", nsec); |
6285
|
|
|
|
|
|
|
nanosleep_init(nsec, &sleepfor, &unslept); |
6286
|
|
|
|
|
|
|
if (nanosleep(&sleepfor, &unslept) == 0) { |
6287
|
|
|
|
|
|
|
RETVAL = nsec; |
6288
|
|
|
|
|
|
|
@@ -1045,11 +1094,15 @@ sleep(...) |
6289
|
|
|
|
|
|
|
useconds = -(IV)useconds; |
6290
|
|
|
|
|
|
|
#endif /* #if defined(__sparc64__) && defined(__GNUC__) */ |
6291
|
|
|
|
|
|
|
if ((IV)useconds < 0) |
6292
|
|
|
|
|
|
|
- croak("Time::HiRes::sleep(%"NVgf"): internal error: useconds < 0 (unsigned %"UVuf" signed %"IVdf")", seconds, useconds, (IV)useconds); |
6293
|
|
|
|
|
|
|
+ croak("Time::HiRes::sleep(%" NVgf |
6294
|
|
|
|
|
|
|
+ "): internal error: useconds < 0 (unsigned %" UVuf |
6295
|
|
|
|
|
|
|
+ " signed %" IVdf ")", |
6296
|
|
|
|
|
|
|
+ seconds, useconds, (IV)useconds); |
6297
|
|
|
|
|
|
|
} |
6298
|
|
|
|
|
|
|
usleep(useconds); |
6299
|
|
|
|
|
|
|
} else |
6300
|
|
|
|
|
|
|
- croak("Time::HiRes::sleep(%"NVgf"): negative time not invented yet", seconds); |
6301
|
|
|
|
|
|
|
+ croak("Time::HiRes::sleep(%" NVgf |
6302
|
|
|
|
|
|
|
+ "): negative time not invented yet", seconds); |
6303
|
|
|
|
|
|
|
} else |
6304
|
|
|
|
|
|
|
PerlProc_pause(); |
6305
|
|
|
|
|
|
|
gettimeofday(&Tb, NULL); |
6306
|
|
|
|
|
|
|
@@ -1097,7 +1150,9 @@ ualarm(useconds,uinterval=0) |
6307
|
|
|
|
|
|
|
} |
6308
|
|
|
|
|
|
|
#else |
6309
|
|
|
|
|
|
|
if (useconds >= IV_1E6 || uinterval >= IV_1E6) |
6310
|
|
|
|
|
|
|
- croak("Time::HiRes::ualarm(%d, %d): useconds or uinterval equal to or more than %"IVdf, useconds, uinterval, IV_1E6); |
6311
|
|
|
|
|
|
|
+ croak("Time::HiRes::ualarm(%d, %d): useconds or uinterval" |
6312
|
|
|
|
|
|
|
+ " equal to or more than %" IVdf, |
6313
|
|
|
|
|
|
|
+ useconds, uinterval, IV_1E6); |
6314
|
|
|
|
|
|
|
RETVAL = ualarm(useconds, uinterval); |
6315
|
|
|
|
|
|
|
#endif |
6316
|
|
|
|
|
|
|
|
6317
|
|
|
|
|
|
|
@@ -1110,7 +1165,8 @@ alarm(seconds,interval=0) |
6318
|
|
|
|
|
|
|
NV interval |
6319
|
|
|
|
|
|
|
CODE: |
6320
|
|
|
|
|
|
|
if (seconds < 0.0 || interval < 0.0) |
6321
|
|
|
|
|
|
|
- croak("Time::HiRes::alarm(%"NVgf", %"NVgf"): negative time not invented yet", seconds, interval); |
6322
|
|
|
|
|
|
|
+ croak("Time::HiRes::alarm(%" NVgf ", %" NVgf |
6323
|
|
|
|
|
|
|
+ "): negative time not invented yet", seconds, interval); |
6324
|
|
|
|
|
|
|
{ |
6325
|
|
|
|
|
|
|
IV iseconds = (IV)seconds; |
6326
|
|
|
|
|
|
|
IV iinterval = (IV)interval; |
6327
|
|
|
|
|
|
|
@@ -1118,7 +1174,9 @@ alarm(seconds,interval=0) |
6328
|
|
|
|
|
|
|
NV finterval = interval - iinterval; |
6329
|
|
|
|
|
|
|
IV useconds, uinterval; |
6330
|
|
|
|
|
|
|
if (fseconds >= 1.0 || finterval >= 1.0) |
6331
|
|
|
|
|
|
|
- croak("Time::HiRes::alarm(%"NVgf", %"NVgf"): seconds or interval too large to split correctly", seconds, interval); |
6332
|
|
|
|
|
|
|
+ croak("Time::HiRes::alarm(%" NVgf ", %" NVgf |
6333
|
|
|
|
|
|
|
+ "): seconds or interval too large to split correctly", |
6334
|
|
|
|
|
|
|
+ seconds, interval); |
6335
|
|
|
|
|
|
|
useconds = IV_1E6 * fseconds; |
6336
|
|
|
|
|
|
|
uinterval = IV_1E6 * finterval; |
6337
|
|
|
|
|
|
|
#if defined(HAS_SETITIMER) && defined(ITIMER_REAL) |
6338
|
|
|
|
|
|
|
@@ -1138,7 +1196,9 @@ alarm(seconds,interval=0) |
6339
|
|
|
|
|
|
|
} |
6340
|
|
|
|
|
|
|
#else |
6341
|
|
|
|
|
|
|
if (iseconds || iinterval) |
6342
|
|
|
|
|
|
|
- croak("Time::HiRes::alarm(%"NVgf", %"NVgf"): seconds or interval equal to or more than 1.0 ", seconds, interval); |
6343
|
|
|
|
|
|
|
+ croak("Time::HiRes::alarm(%" NVgf ", %" NVgf |
6344
|
|
|
|
|
|
|
+ "): seconds or interval equal to or more than 1.0 ", |
6345
|
|
|
|
|
|
|
+ seconds, interval); |
6346
|
|
|
|
|
|
|
RETVAL = (NV)ualarm( useconds, uinterval ) / NV_1E6; |
6347
|
|
|
|
|
|
|
#endif |
6348
|
|
|
|
|
|
|
} |
6349
|
|
|
|
|
|
|
@@ -1266,7 +1326,9 @@ setitimer(which, seconds, interval = 0) |
6350
|
|
|
|
|
|
|
struct itimerval oldit; |
6351
|
|
|
|
|
|
|
PPCODE: |
6352
|
|
|
|
|
|
|
if (seconds < 0.0 || interval < 0.0) |
6353
|
|
|
|
|
|
|
- croak("Time::HiRes::setitimer(%"IVdf", %"NVgf", %"NVgf"): negative time not invented yet", (IV)which, seconds, interval); |
6354
|
|
|
|
|
|
|
+ croak("Time::HiRes::setitimer(%" IVdf ", %" NVgf ", %" NVgf |
6355
|
|
|
|
|
|
|
+ "): negative time not invented yet", |
6356
|
|
|
|
|
|
|
+ (IV)which, seconds, interval); |
6357
|
|
|
|
|
|
|
newit.it_value.tv_sec = (IV)seconds; |
6358
|
|
|
|
|
|
|
newit.it_value.tv_usec = |
6359
|
|
|
|
|
|
|
(IV)((seconds - (NV)newit.it_value.tv_sec) * NV_1E6); |
6360
|
|
|
|
|
|
|
@@ -1317,11 +1379,89 @@ getitimer(which) |
6361
|
|
|
|
|
|
|
|
6362
|
|
|
|
|
|
|
#endif /* #if defined(HAS_GETITIMER) && defined(HAS_SETITIMER) */ |
6363
|
|
|
|
|
|
|
|
6364
|
|
|
|
|
|
|
+#if defined(TIME_HIRES_UTIME) |
6365
|
|
|
|
|
|
|
+ |
6366
|
|
|
|
|
|
|
+I32 |
6367
|
|
|
|
|
|
|
+utime(accessed, modified, ...) |
6368
|
|
|
|
|
|
|
+PROTOTYPE: $$@ |
6369
|
|
|
|
|
|
|
+ PREINIT: |
6370
|
|
|
|
|
|
|
+ SV* accessed; |
6371
|
|
|
|
|
|
|
+ SV* modified; |
6372
|
|
|
|
|
|
|
+ SV* file; |
6373
|
|
|
|
|
|
|
+ |
6374
|
|
|
|
|
|
|
+ struct timespec utbuf[2]; |
6375
|
|
|
|
|
|
|
+ struct timespec *utbufp = utbuf; |
6376
|
|
|
|
|
|
|
+ int tot; |
6377
|
|
|
|
|
|
|
+ |
6378
|
|
|
|
|
|
|
+ CODE: |
6379
|
|
|
|
|
|
|
+ accessed = ST(0); |
6380
|
|
|
|
|
|
|
+ modified = ST(1); |
6381
|
|
|
|
|
|
|
+ items -= 2; |
6382
|
|
|
|
|
|
|
+ tot = 0; |
6383
|
|
|
|
|
|
|
+ |
6384
|
|
|
|
|
|
|
+ if ( accessed == &PL_sv_undef && modified == &PL_sv_undef ) |
6385
|
|
|
|
|
|
|
+ utbufp = NULL; |
6386
|
|
|
|
|
|
|
+ else { |
6387
|
|
|
|
|
|
|
+ if (SvNV(accessed) < 0.0 || SvNV(modified) < 0.0) |
6388
|
|
|
|
|
|
|
+ croak("Time::HiRes::utime(%" NVgf ", %" NVgf |
6389
|
|
|
|
|
|
|
+ "): negative time not invented yet", |
6390
|
|
|
|
|
|
|
+ SvNV(accessed), SvNV(modified)); |
6391
|
|
|
|
|
|
|
+ Zero(&utbuf, sizeof utbuf, char); |
6392
|
|
|
|
|
|
|
+ utbuf[0].tv_sec = (Time_t)SvNV(accessed); /* time accessed */ |
6393
|
|
|
|
|
|
|
+ utbuf[0].tv_nsec = (long)( ( SvNV(accessed) - utbuf[0].tv_sec ) * 1e9 ); |
6394
|
|
|
|
|
|
|
+ utbuf[1].tv_sec = (Time_t)SvNV(modified); /* time modified */ |
6395
|
|
|
|
|
|
|
+ utbuf[1].tv_nsec = (long)( ( SvNV(modified) - utbuf[1].tv_sec ) * 1e9 ); |
6396
|
|
|
|
|
|
|
+ } |
6397
|
|
|
|
|
|
|
+ |
6398
|
|
|
|
|
|
|
+ while (items > 0) { |
6399
|
|
|
|
|
|
|
+ file = POPs; items--; |
6400
|
|
|
|
|
|
|
+ |
6401
|
|
|
|
|
|
|
+ if (SvROK(file) && GvIO(SvRV(file)) && IoIFP(sv_2io(SvRV(file)))) { |
6402
|
|
|
|
|
|
|
+ int fd = PerlIO_fileno(IoIFP(sv_2io(file))); |
6403
|
|
|
|
|
|
|
+ if (fd < 0) |
6404
|
|
|
|
|
|
|
+ SETERRNO(EBADF,RMS_IFI); |
6405
|
|
|
|
|
|
|
+ else |
6406
|
|
|
|
|
|
|
+#ifdef HAS_FUTIMENS |
6407
|
|
|
|
|
|
|
+ if (futimens(fd, utbufp) == 0) |
6408
|
|
|
|
|
|
|
+ tot++; |
6409
|
|
|
|
|
|
|
+#else /* HAS_FUTIMES */ |
6410
|
|
|
|
|
|
|
+ croak("futimens unimplemented in this platform"); |
6411
|
|
|
|
|
|
|
+#endif /* HAS_FUTIMES */ |
6412
|
|
|
|
|
|
|
+ } |
6413
|
|
|
|
|
|
|
+ else { |
6414
|
|
|
|
|
|
|
+#ifdef HAS_UTIMENSAT |
6415
|
|
|
|
|
|
|
+ STRLEN len; |
6416
|
|
|
|
|
|
|
+ char * name = SvPV(file, len); |
6417
|
|
|
|
|
|
|
+ if (IS_SAFE_PATHNAME(name, len, "utime") && |
6418
|
|
|
|
|
|
|
+ utimensat(AT_FDCWD, name, utbufp, 0) == 0) |
6419
|
|
|
|
|
|
|
+ tot++; |
6420
|
|
|
|
|
|
|
+#else /* HAS_UTIMENSAT */ |
6421
|
|
|
|
|
|
|
+ croak("utimensat unimplemented in this platform"); |
6422
|
|
|
|
|
|
|
+#endif /* HAS_UTIMENSAT */ |
6423
|
|
|
|
|
|
|
+ } |
6424
|
|
|
|
|
|
|
+ } /* while items */ |
6425
|
|
|
|
|
|
|
+ RETVAL = tot; |
6426
|
|
|
|
|
|
|
+ |
6427
|
|
|
|
|
|
|
+ OUTPUT: |
6428
|
|
|
|
|
|
|
+ RETVAL |
6429
|
|
|
|
|
|
|
+ |
6430
|
|
|
|
|
|
|
+#else /* #if defined(TIME_HIRES_UTIME) */ |
6431
|
|
|
|
|
|
|
+ |
6432
|
|
|
|
|
|
|
+I32 |
6433
|
|
|
|
|
|
|
+utime(accessed, modified, ...) |
6434
|
|
|
|
|
|
|
+ CODE: |
6435
|
|
|
|
|
|
|
+ croak("Time::HiRes::utime(): unimplemented in this platform"); |
6436
|
|
|
|
|
|
|
+ RETVAL = 0; |
6437
|
|
|
|
|
|
|
+ OUTPUT: |
6438
|
|
|
|
|
|
|
+ RETVAL |
6439
|
|
|
|
|
|
|
+ |
6440
|
|
|
|
|
|
|
+#endif /* #if defined(TIME_HIRES_UTIME) */ |
6441
|
|
|
|
|
|
|
+ |
6442
|
|
|
|
|
|
|
#if defined(TIME_HIRES_CLOCK_GETTIME) |
6443
|
|
|
|
|
|
|
|
6444
|
|
|
|
|
|
|
NV |
6445
|
|
|
|
|
|
|
clock_gettime(clock_id = CLOCK_REALTIME) |
6446
|
|
|
|
|
|
|
- int clock_id |
6447
|
|
|
|
|
|
|
+ clockid_t clock_id |
6448
|
|
|
|
|
|
|
PREINIT: |
6449
|
|
|
|
|
|
|
struct timespec ts; |
6450
|
|
|
|
|
|
|
int status = -1; |
6451
|
|
|
|
|
|
|
@@ -1340,7 +1480,7 @@ clock_gettime(clock_id = CLOCK_REALTIME) |
6452
|
|
|
|
|
|
|
|
6453
|
|
|
|
|
|
|
NV |
6454
|
|
|
|
|
|
|
clock_gettime(clock_id = 0) |
6455
|
|
|
|
|
|
|
- int clock_id |
6456
|
|
|
|
|
|
|
+ clockid_t clock_id |
6457
|
|
|
|
|
|
|
CODE: |
6458
|
|
|
|
|
|
|
PERL_UNUSED_ARG(clock_id); |
6459
|
|
|
|
|
|
|
croak("Time::HiRes::clock_gettime(): unimplemented in this platform"); |
6460
|
|
|
|
|
|
|
@@ -1354,7 +1494,7 @@ clock_gettime(clock_id = 0) |
6461
|
|
|
|
|
|
|
|
6462
|
|
|
|
|
|
|
NV |
6463
|
|
|
|
|
|
|
clock_getres(clock_id = CLOCK_REALTIME) |
6464
|
|
|
|
|
|
|
- int clock_id |
6465
|
|
|
|
|
|
|
+ clockid_t clock_id |
6466
|
|
|
|
|
|
|
PREINIT: |
6467
|
|
|
|
|
|
|
int status = -1; |
6468
|
|
|
|
|
|
|
struct timespec ts; |
6469
|
|
|
|
|
|
|
@@ -1373,7 +1513,7 @@ clock_getres(clock_id = CLOCK_REALTIME) |
6470
|
|
|
|
|
|
|
|
6471
|
|
|
|
|
|
|
NV |
6472
|
|
|
|
|
|
|
clock_getres(clock_id = 0) |
6473
|
|
|
|
|
|
|
- int clock_id |
6474
|
|
|
|
|
|
|
+ clockid_t clock_id |
6475
|
|
|
|
|
|
|
CODE: |
6476
|
|
|
|
|
|
|
PERL_UNUSED_ARG(clock_id); |
6477
|
|
|
|
|
|
|
croak("Time::HiRes::clock_getres(): unimplemented in this platform"); |
6478
|
|
|
|
|
|
|
@@ -1387,14 +1527,15 @@ clock_getres(clock_id = 0) |
6479
|
|
|
|
|
|
|
|
6480
|
|
|
|
|
|
|
NV |
6481
|
|
|
|
|
|
|
clock_nanosleep(clock_id, nsec, flags = 0) |
6482
|
|
|
|
|
|
|
- int clock_id |
6483
|
|
|
|
|
|
|
+ clockid_t clock_id |
6484
|
|
|
|
|
|
|
NV nsec |
6485
|
|
|
|
|
|
|
int flags |
6486
|
|
|
|
|
|
|
PREINIT: |
6487
|
|
|
|
|
|
|
struct timespec sleepfor, unslept; |
6488
|
|
|
|
|
|
|
CODE: |
6489
|
|
|
|
|
|
|
if (nsec < 0.0) |
6490
|
|
|
|
|
|
|
- croak("Time::HiRes::clock_nanosleep(..., %"NVgf"): negative time not invented yet", nsec); |
6491
|
|
|
|
|
|
|
+ croak("Time::HiRes::clock_nanosleep(..., %" NVgf |
6492
|
|
|
|
|
|
|
+ "): negative time not invented yet", nsec); |
6493
|
|
|
|
|
|
|
nanosleep_init(nsec, &sleepfor, &unslept); |
6494
|
|
|
|
|
|
|
if (clock_nanosleep(clock_id, flags, &sleepfor, &unslept) == 0) { |
6495
|
|
|
|
|
|
|
RETVAL = nsec; |
6496
|
|
|
|
|
|
|
@@ -1408,7 +1549,7 @@ clock_nanosleep(clock_id, nsec, flags = 0) |
6497
|
|
|
|
|
|
|
|
6498
|
|
|
|
|
|
|
NV |
6499
|
|
|
|
|
|
|
clock_nanosleep(clock_id, nsec, flags = 0) |
6500
|
|
|
|
|
|
|
- int clock_id |
6501
|
|
|
|
|
|
|
+ clockid_t clock_id |
6502
|
|
|
|
|
|
|
NV nsec |
6503
|
|
|
|
|
|
|
int flags |
6504
|
|
|
|
|
|
|
CODE: |
6505
|
|
|
|
|
|
|
diff --git a/dist/Time-HiRes/Makefile.PL b/dist/Time-HiRes/Makefile.PL |
6506
|
|
|
|
|
|
|
index 087ab79871..ccad6a3e6f 100644 |
6507
|
|
|
|
|
|
|
--- dist/Time-HiRes/Makefile.PL |
6508
|
|
|
|
|
|
|
+++ dist/Time-HiRes/Makefile.PL |
6509
|
|
|
|
|
|
|
@@ -88,7 +88,7 @@ sub try_compile_and_link { |
6510
|
|
|
|
|
|
|
my $obj_ext = $Config{obj_ext} || ".o"; |
6511
|
|
|
|
|
|
|
unlink("$tmp.c", "$tmp$obj_ext"); |
6512
|
|
|
|
|
|
|
|
6513
|
|
|
|
|
|
|
- if (open(TMPC, ">$tmp.c")) { |
6514
|
|
|
|
|
|
|
+ if (open(TMPC, '>', "$tmp.c")) { |
6515
|
|
|
|
|
|
|
print TMPC $c; |
6516
|
|
|
|
|
|
|
close(TMPC); |
6517
|
|
|
|
|
|
|
|
6518
|
|
|
|
|
|
|
@@ -132,7 +132,7 @@ __EOD__ |
6519
|
|
|
|
|
|
|
unless defined $cccmd; |
6520
|
|
|
|
|
|
|
|
6521
|
|
|
|
|
|
|
if ($^O eq 'VMS') { |
6522
|
|
|
|
|
|
|
- open( CMDFILE, ">$tmp.com" ); |
6523
|
|
|
|
|
|
|
+ open( CMDFILE, '>', "$tmp.com" ); |
6524
|
|
|
|
|
|
|
print CMDFILE "\$ SET MESSAGE/NOFACILITY/NOSEVERITY/NOIDENT/NOTEXT\n"; |
6525
|
|
|
|
|
|
|
print CMDFILE "\$ $cccmd\n"; |
6526
|
|
|
|
|
|
|
print CMDFILE "\$ IF \$SEVERITY .NE. 1 THEN EXIT 44\n"; # escalate |
6527
|
|
|
|
|
|
|
@@ -290,6 +290,7 @@ sub has_clock_xxx_syscall { |
6528
|
|
|
|
|
|
|
#include "EXTERN.h" |
6529
|
|
|
|
|
|
|
#include "perl.h" |
6530
|
|
|
|
|
|
|
#include "XSUB.h" |
6531
|
|
|
|
|
|
|
+#include |
6532
|
|
|
|
|
|
|
#include <$SYSCALL_H> |
6533
|
|
|
|
|
|
|
int main(int argc, char** argv) |
6534
|
|
|
|
|
|
|
{ |
6535
|
|
|
|
|
|
|
@@ -309,6 +310,7 @@ sub has_clock_xxx { |
6536
|
|
|
|
|
|
|
#include "EXTERN.h" |
6537
|
|
|
|
|
|
|
#include "perl.h" |
6538
|
|
|
|
|
|
|
#include "XSUB.h" |
6539
|
|
|
|
|
|
|
+#include |
6540
|
|
|
|
|
|
|
int main(int argc, char** argv) |
6541
|
|
|
|
|
|
|
{ |
6542
|
|
|
|
|
|
|
struct timespec ts; |
6543
|
|
|
|
|
|
|
@@ -325,6 +327,7 @@ sub has_clock { |
6544
|
|
|
|
|
|
|
#include "EXTERN.h" |
6545
|
|
|
|
|
|
|
#include "perl.h" |
6546
|
|
|
|
|
|
|
#include "XSUB.h" |
6547
|
|
|
|
|
|
|
+#include |
6548
|
|
|
|
|
|
|
int main(int argc, char** argv) |
6549
|
|
|
|
|
|
|
{ |
6550
|
|
|
|
|
|
|
clock_t tictoc; |
6551
|
|
|
|
|
|
|
@@ -348,12 +351,63 @@ int main(int argc, char** argv) |
6552
|
|
|
|
|
|
|
struct timespec ts2; |
6553
|
|
|
|
|
|
|
ts1.tv_sec = 0; |
6554
|
|
|
|
|
|
|
ts1.tv_nsec = 750000000;; |
6555
|
|
|
|
|
|
|
- ret = clock_nanosleep(CLOCK_MONOTONIC, 0, &ts1, &ts2); |
6556
|
|
|
|
|
|
|
+ /* All implementations are supposed to support CLOCK_REALTIME. */ |
6557
|
|
|
|
|
|
|
+ ret = clock_nanosleep(CLOCK_REALTIME, 0, &ts1, &ts2); |
6558
|
|
|
|
|
|
|
ret == 0 ? exit(0) : exit(errno ? errno : -1); |
6559
|
|
|
|
|
|
|
} |
6560
|
|
|
|
|
|
|
EOM |
6561
|
|
|
|
|
|
|
} |
6562
|
|
|
|
|
|
|
|
6563
|
|
|
|
|
|
|
+sub has_futimens { |
6564
|
|
|
|
|
|
|
+ return 1 if |
6565
|
|
|
|
|
|
|
+ try_compile_and_link(<
|
6566
|
|
|
|
|
|
|
+#include "EXTERN.h" |
6567
|
|
|
|
|
|
|
+#include "perl.h" |
6568
|
|
|
|
|
|
|
+#include "XSUB.h" |
6569
|
|
|
|
|
|
|
+#include |
6570
|
|
|
|
|
|
|
+int main(int argc, char** argv) |
6571
|
|
|
|
|
|
|
+{ |
6572
|
|
|
|
|
|
|
+ int ret; |
6573
|
|
|
|
|
|
|
+ struct timespec ts[2]; |
6574
|
|
|
|
|
|
|
+ ret = futimens(0, ts); |
6575
|
|
|
|
|
|
|
+ ret == 0 ? exit(0) : exit(errno ? errno : -1); |
6576
|
|
|
|
|
|
|
+} |
6577
|
|
|
|
|
|
|
+EOM |
6578
|
|
|
|
|
|
|
+} |
6579
|
|
|
|
|
|
|
+ |
6580
|
|
|
|
|
|
|
+sub has_utimensat{ |
6581
|
|
|
|
|
|
|
+ return 1 if |
6582
|
|
|
|
|
|
|
+ try_compile_and_link(<
|
6583
|
|
|
|
|
|
|
+#include "EXTERN.h" |
6584
|
|
|
|
|
|
|
+#include "perl.h" |
6585
|
|
|
|
|
|
|
+#include "XSUB.h" |
6586
|
|
|
|
|
|
|
+#include |
6587
|
|
|
|
|
|
|
+#include |
6588
|
|
|
|
|
|
|
+int main(int argc, char** argv) |
6589
|
|
|
|
|
|
|
+{ |
6590
|
|
|
|
|
|
|
+ int ret; |
6591
|
|
|
|
|
|
|
+ struct timespec ts[2]; |
6592
|
|
|
|
|
|
|
+ ret = utimensat(AT_FDCWD, 0, ts, 0); |
6593
|
|
|
|
|
|
|
+ ret == 0 ? exit(0) : exit(errno ? errno : -1); |
6594
|
|
|
|
|
|
|
+} |
6595
|
|
|
|
|
|
|
+EOM |
6596
|
|
|
|
|
|
|
+} |
6597
|
|
|
|
|
|
|
+ |
6598
|
|
|
|
|
|
|
+sub has_clockid_t{ |
6599
|
|
|
|
|
|
|
+ return 1 if |
6600
|
|
|
|
|
|
|
+ try_compile_and_link(<
|
6601
|
|
|
|
|
|
|
+#include "EXTERN.h" |
6602
|
|
|
|
|
|
|
+#include "perl.h" |
6603
|
|
|
|
|
|
|
+#include "XSUB.h" |
6604
|
|
|
|
|
|
|
+#include |
6605
|
|
|
|
|
|
|
+int main(int argc, char** argv) |
6606
|
|
|
|
|
|
|
+{ |
6607
|
|
|
|
|
|
|
+ clockid_t id = CLOCK_REALTIME; |
6608
|
|
|
|
|
|
|
+ exit(id == CLOCK_REALTIME ? 1 : 0); |
6609
|
|
|
|
|
|
|
+} |
6610
|
|
|
|
|
|
|
+EOM |
6611
|
|
|
|
|
|
|
+} |
6612
|
|
|
|
|
|
|
+ |
6613
|
|
|
|
|
|
|
sub DEFINE { |
6614
|
|
|
|
|
|
|
my ($def, $val) = @_; |
6615
|
|
|
|
|
|
|
my $define = defined $val ? "$def=$val" : $def ; |
6616
|
|
|
|
|
|
|
@@ -534,6 +588,16 @@ EOD |
6617
|
|
|
|
|
|
|
print "(It would not be portable anyway.)\n"; |
6618
|
|
|
|
|
|
|
} |
6619
|
|
|
|
|
|
|
|
6620
|
|
|
|
|
|
|
+ print "Looking for clockid_t... "; |
6621
|
|
|
|
|
|
|
+ my $has_clockid_t; |
6622
|
|
|
|
|
|
|
+ if (has_clockid_t()) { |
6623
|
|
|
|
|
|
|
+ print "found.\n"; |
6624
|
|
|
|
|
|
|
+ $has_clockid_t++; |
6625
|
|
|
|
|
|
|
+ $DEFINE .= ' -DTIME_HIRES_CLOCKID_T'; |
6626
|
|
|
|
|
|
|
+ } else { |
6627
|
|
|
|
|
|
|
+ print "NOT found, will use int.\n"; |
6628
|
|
|
|
|
|
|
+ } |
6629
|
|
|
|
|
|
|
+ |
6630
|
|
|
|
|
|
|
print "Looking for clock_gettime()... "; |
6631
|
|
|
|
|
|
|
my $has_clock_gettime; |
6632
|
|
|
|
|
|
|
my $has_clock_gettime_emulation; |
6633
|
|
|
|
|
|
|
@@ -548,7 +612,7 @@ EOD |
6634
|
|
|
|
|
|
|
} elsif ($^O eq 'darwin') { |
6635
|
|
|
|
|
|
|
$has_clock_gettime_emulation++; |
6636
|
|
|
|
|
|
|
$has_clock_gettime++; |
6637
|
|
|
|
|
|
|
- $DEFINE .= ' -DTIME_HIRES_CLOCK_GETTIME'; |
6638
|
|
|
|
|
|
|
+ $DEFINE .= ' -DTIME_HIRES_CLOCK_GETTIME -DTIME_HIRES_CLOCK_GETTIME_EMULATION'; |
6639
|
|
|
|
|
|
|
} |
6640
|
|
|
|
|
|
|
|
6641
|
|
|
|
|
|
|
if ($has_clock_gettime) { |
6642
|
|
|
|
|
|
|
@@ -577,7 +641,7 @@ EOD |
6643
|
|
|
|
|
|
|
} elsif ($^O eq 'darwin') { |
6644
|
|
|
|
|
|
|
$has_clock_getres_emulation++; |
6645
|
|
|
|
|
|
|
$has_clock_getres++; |
6646
|
|
|
|
|
|
|
- $DEFINE .= ' -DTIME_HIRES_CLOCK_GETRES'; |
6647
|
|
|
|
|
|
|
+ $DEFINE .= ' -DTIME_HIRES_CLOCK_GETRES -DTIME_HIRES_CLOCK_GETRES_EMULATION'; |
6648
|
|
|
|
|
|
|
} |
6649
|
|
|
|
|
|
|
|
6650
|
|
|
|
|
|
|
if ($has_clock_getres) { |
6651
|
|
|
|
|
|
|
@@ -603,7 +667,7 @@ EOD |
6652
|
|
|
|
|
|
|
} elsif ($^O eq 'darwin') { |
6653
|
|
|
|
|
|
|
$has_clock_nanosleep++; |
6654
|
|
|
|
|
|
|
$has_clock_nanosleep_emulation++; |
6655
|
|
|
|
|
|
|
- $DEFINE .= ' -DTIME_HIRES_CLOCK_NANOSLEEP'; |
6656
|
|
|
|
|
|
|
+ $DEFINE .= ' -DTIME_HIRES_CLOCK_NANOSLEEP -DTIME_HIRES_CLOCK_NANOSLEEP_EMULATION'; |
6657
|
|
|
|
|
|
|
} |
6658
|
|
|
|
|
|
|
|
6659
|
|
|
|
|
|
|
if ($has_clock_nanosleep) { |
6660
|
|
|
|
|
|
|
@@ -631,6 +695,36 @@ EOD |
6661
|
|
|
|
|
|
|
print "NOT found.\n"; |
6662
|
|
|
|
|
|
|
} |
6663
|
|
|
|
|
|
|
|
6664
|
|
|
|
|
|
|
+ print "Looking for futimens()... "; |
6665
|
|
|
|
|
|
|
+ my $has_futimens; |
6666
|
|
|
|
|
|
|
+ if (has_futimens()) { |
6667
|
|
|
|
|
|
|
+ $has_futimens++; |
6668
|
|
|
|
|
|
|
+ $DEFINE .= ' -DHAS_FUTIMENS'; |
6669
|
|
|
|
|
|
|
+ } |
6670
|
|
|
|
|
|
|
+ |
6671
|
|
|
|
|
|
|
+ if ($has_futimens) { |
6672
|
|
|
|
|
|
|
+ print "found.\n"; |
6673
|
|
|
|
|
|
|
+ } else { |
6674
|
|
|
|
|
|
|
+ print "NOT found.\n"; |
6675
|
|
|
|
|
|
|
+ } |
6676
|
|
|
|
|
|
|
+ |
6677
|
|
|
|
|
|
|
+ print "Looking for utimensat()... "; |
6678
|
|
|
|
|
|
|
+ my $has_utimensat; |
6679
|
|
|
|
|
|
|
+ if (has_utimensat()) { |
6680
|
|
|
|
|
|
|
+ $has_utimensat++; |
6681
|
|
|
|
|
|
|
+ $DEFINE .= ' -DHAS_UTIMENSAT'; |
6682
|
|
|
|
|
|
|
+ } |
6683
|
|
|
|
|
|
|
+ |
6684
|
|
|
|
|
|
|
+ if ($has_utimensat) { |
6685
|
|
|
|
|
|
|
+ print "found.\n"; |
6686
|
|
|
|
|
|
|
+ } else { |
6687
|
|
|
|
|
|
|
+ print "NOT found.\n"; |
6688
|
|
|
|
|
|
|
+ } |
6689
|
|
|
|
|
|
|
+ |
6690
|
|
|
|
|
|
|
+ if ($has_futimens or $has_utimensat) { |
6691
|
|
|
|
|
|
|
+ $DEFINE .= ' -DTIME_HIRES_UTIME'; |
6692
|
|
|
|
|
|
|
+ } |
6693
|
|
|
|
|
|
|
+ |
6694
|
|
|
|
|
|
|
print "Looking for stat() subsecond timestamps...\n"; |
6695
|
|
|
|
|
|
|
|
6696
|
|
|
|
|
|
|
print "Trying struct stat st_atimespec.tv_nsec..."; |
6697
|
|
|
|
|
|
|
@@ -644,7 +738,7 @@ int main(int argc, char** argv) { |
6698
|
|
|
|
|
|
|
} |
6699
|
|
|
|
|
|
|
EOM |
6700
|
|
|
|
|
|
|
$has_stat_st_xtimespec++; |
6701
|
|
|
|
|
|
|
- DEFINE('TIME_HIRES_STAT', 1); |
6702
|
|
|
|
|
|
|
+ DEFINE('TIME_HIRES_STAT_ST_XTIMESPEC'); # 1 |
6703
|
|
|
|
|
|
|
} |
6704
|
|
|
|
|
|
|
|
6705
|
|
|
|
|
|
|
if ($has_stat_st_xtimespec) { |
6706
|
|
|
|
|
|
|
@@ -664,7 +758,7 @@ int main(int argc, char** argv) { |
6707
|
|
|
|
|
|
|
} |
6708
|
|
|
|
|
|
|
EOM |
6709
|
|
|
|
|
|
|
$has_stat_st_xtimensec++; |
6710
|
|
|
|
|
|
|
- DEFINE('TIME_HIRES_STAT', 2); |
6711
|
|
|
|
|
|
|
+ DEFINE('TIME_HIRES_STAT_ST_XTIMENSEC'); # 2 |
6712
|
|
|
|
|
|
|
} |
6713
|
|
|
|
|
|
|
|
6714
|
|
|
|
|
|
|
if ($has_stat_st_xtimensec) { |
6715
|
|
|
|
|
|
|
@@ -684,7 +778,7 @@ int main(int argc, char** argv) { |
6716
|
|
|
|
|
|
|
} |
6717
|
|
|
|
|
|
|
EOM |
6718
|
|
|
|
|
|
|
$has_stat_st_xtime_n++; |
6719
|
|
|
|
|
|
|
- DEFINE('TIME_HIRES_STAT', 3); |
6720
|
|
|
|
|
|
|
+ DEFINE('TIME_HIRES_STAT_ST_XTIME_N'); # 3 |
6721
|
|
|
|
|
|
|
} |
6722
|
|
|
|
|
|
|
|
6723
|
|
|
|
|
|
|
if ($has_stat_st_xtime_n) { |
6724
|
|
|
|
|
|
|
@@ -704,7 +798,7 @@ int main(int argc, char** argv) { |
6725
|
|
|
|
|
|
|
} |
6726
|
|
|
|
|
|
|
EOM |
6727
|
|
|
|
|
|
|
$has_stat_st_xtim++; |
6728
|
|
|
|
|
|
|
- DEFINE('TIME_HIRES_STAT', 4); |
6729
|
|
|
|
|
|
|
+ DEFINE('TIME_HIRES_STAT_XTIM'); # 4 |
6730
|
|
|
|
|
|
|
} |
6731
|
|
|
|
|
|
|
|
6732
|
|
|
|
|
|
|
if ($has_stat_st_xtim) { |
6733
|
|
|
|
|
|
|
@@ -724,7 +818,7 @@ int main(int argc, char** argv) { |
6734
|
|
|
|
|
|
|
} |
6735
|
|
|
|
|
|
|
EOM |
6736
|
|
|
|
|
|
|
$has_stat_st_uxtime++; |
6737
|
|
|
|
|
|
|
- DEFINE('TIME_HIRES_STAT', 5); |
6738
|
|
|
|
|
|
|
+ DEFINE('TIME_HIRES_STAT_ST_UXTIME'); # 5 |
6739
|
|
|
|
|
|
|
} |
6740
|
|
|
|
|
|
|
|
6741
|
|
|
|
|
|
|
if ($has_stat_st_uxtime) { |
6742
|
|
|
|
|
|
|
@@ -733,6 +827,19 @@ EOM |
6743
|
|
|
|
|
|
|
print "NOT found.\n"; |
6744
|
|
|
|
|
|
|
} |
6745
|
|
|
|
|
|
|
|
6746
|
|
|
|
|
|
|
+ # See HiRes.xs hrstatns() |
6747
|
|
|
|
|
|
|
+ if ($has_stat_st_xtimespec) { |
6748
|
|
|
|
|
|
|
+ DEFINE('TIME_HIRES_STAT', 1); |
6749
|
|
|
|
|
|
|
+ } elsif ($has_stat_st_xtimensec) { |
6750
|
|
|
|
|
|
|
+ DEFINE('TIME_HIRES_STAT', 2); |
6751
|
|
|
|
|
|
|
+ } elsif ($has_stat_st_xtime_n) { |
6752
|
|
|
|
|
|
|
+ DEFINE('TIME_HIRES_STAT', 3); |
6753
|
|
|
|
|
|
|
+ } elsif ($has_stat_st_xtim) { |
6754
|
|
|
|
|
|
|
+ DEFINE('TIME_HIRES_STAT', 4); |
6755
|
|
|
|
|
|
|
+ } elsif ($has_stat_st_uxtime) { |
6756
|
|
|
|
|
|
|
+ DEFINE('TIME_HIRES_STAT', 5); |
6757
|
|
|
|
|
|
|
+ } |
6758
|
|
|
|
|
|
|
+ |
6759
|
|
|
|
|
|
|
if ($DEFINE =~ /-DTIME_HIRES_STAT=\d+/) { |
6760
|
|
|
|
|
|
|
print "You seem to have stat() subsecond timestamps.\n"; |
6761
|
|
|
|
|
|
|
print "(Your struct stat has them, but the filesystems must help.)\n"; |
6762
|
|
|
|
|
|
|
@@ -757,7 +864,7 @@ EOM |
6763
|
|
|
|
|
|
|
|
6764
|
|
|
|
|
|
|
if ($DEFINE) { |
6765
|
|
|
|
|
|
|
$DEFINE =~ s/^\s+//; |
6766
|
|
|
|
|
|
|
- if (open(XDEFINE, ">xdefine")) { |
6767
|
|
|
|
|
|
|
+ if (open(XDEFINE, '>', 'xdefine')) { |
6768
|
|
|
|
|
|
|
print XDEFINE $DEFINE, "\n"; |
6769
|
|
|
|
|
|
|
close(XDEFINE); |
6770
|
|
|
|
|
|
|
} |
6771
|
|
|
|
|
|
|
@@ -791,7 +898,7 @@ sub doMakefile { |
6772
|
|
|
|
|
|
|
'DynaLoader' => 0, |
6773
|
|
|
|
|
|
|
'Exporter' => 0, |
6774
|
|
|
|
|
|
|
'ExtUtils::MakeMaker' => 0, |
6775
|
|
|
|
|
|
|
- 'Test::More' => "0.82", |
6776
|
|
|
|
|
|
|
+ 'Test::More' => 0, |
6777
|
|
|
|
|
|
|
'strict' => 0, |
6778
|
|
|
|
|
|
|
}, |
6779
|
|
|
|
|
|
|
'dist' => { |
6780
|
|
|
|
|
|
|
@@ -869,7 +976,8 @@ sub doConstants { |
6781
|
|
|
|
|
|
|
); |
6782
|
|
|
|
|
|
|
foreach (qw (d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer |
6783
|
|
|
|
|
|
|
d_nanosleep d_clock_gettime d_clock_getres |
6784
|
|
|
|
|
|
|
- d_clock d_clock_nanosleep d_hires_stat)) { |
6785
|
|
|
|
|
|
|
+ d_clock d_clock_nanosleep d_hires_stat |
6786
|
|
|
|
|
|
|
+ d_futimens d_utimensat d_hires_utime)) { |
6787
|
|
|
|
|
|
|
my $macro = $_; |
6788
|
|
|
|
|
|
|
if ($macro =~ /^(d_nanosleep|d_clock)$/) { |
6789
|
|
|
|
|
|
|
$macro =~ s/^d_(.+)/TIME_HIRES_\U$1/; |
6790
|
|
|
|
|
|
|
@@ -879,6 +987,13 @@ sub doConstants { |
6791
|
|
|
|
|
|
|
push @names, {name => $_, macro => "TIME_HIRES_STAT", value => $d_hires_stat, |
6792
|
|
|
|
|
|
|
default => ["IV", "0"]}; |
6793
|
|
|
|
|
|
|
next; |
6794
|
|
|
|
|
|
|
+ } elsif ($macro =~ /^(d_hires_utime)$/) { |
6795
|
|
|
|
|
|
|
+ my $d_hires_utime = |
6796
|
|
|
|
|
|
|
+ ($DEFINE =~ /-DHAS_FUTIMENS/ || |
6797
|
|
|
|
|
|
|
+ $DEFINE =~ /-DHAS_UTIMENSAT/) ? 1 : 0; |
6798
|
|
|
|
|
|
|
+ push @names, {name => $_, macro => "TIME_HIRES_UTIME", value => $d_hires_utime, |
6799
|
|
|
|
|
|
|
+ default => ["IV", "0"]}; |
6800
|
|
|
|
|
|
|
+ next; |
6801
|
|
|
|
|
|
|
} elsif ($macro =~ /^(d_clock_gettime|d_clock_getres|d_clock_nanosleep)$/) { |
6802
|
|
|
|
|
|
|
$macro =~ s/^d_(.+)/TIME_HIRES_\U$1/; |
6803
|
|
|
|
|
|
|
my $val = ($DEFINE =~ /-D$macro\b/) ? 1 : 0; |
6804
|
|
|
|
|
|
|
@@ -900,8 +1015,8 @@ sub doConstants { |
6805
|
|
|
|
|
|
|
foreach $file ('const-c.inc', 'const-xs.inc') { |
6806
|
|
|
|
|
|
|
my $fallback = File::Spec->catfile('fallback', $file); |
6807
|
|
|
|
|
|
|
local $/; |
6808
|
|
|
|
|
|
|
- open IN, "<$fallback" or die "Can't open $fallback: $!"; |
6809
|
|
|
|
|
|
|
- open OUT, ">$file" or die "Can't open $file: $!"; |
6810
|
|
|
|
|
|
|
+ open IN, '<', $fallback or die "Can't open $fallback: $!"; |
6811
|
|
|
|
|
|
|
+ open OUT, '>', $file or die "Can't open $file: $!"; |
6812
|
|
|
|
|
|
|
print OUT or die $!; |
6813
|
|
|
|
|
|
|
close OUT or die "Can't close $file: $!"; |
6814
|
|
|
|
|
|
|
close IN or die "Can't close $fallback: $!"; |
6815
|
|
|
|
|
|
|
@@ -920,7 +1035,7 @@ sub main { |
6816
|
|
|
|
|
|
|
DEFINE('SELECT_IS_BROKEN'); |
6817
|
|
|
|
|
|
|
$LIBS = []; |
6818
|
|
|
|
|
|
|
print "System is $^O, skipping full configure...\n"; |
6819
|
|
|
|
|
|
|
- open(XDEFINE, ">xdefine") or die "$0: Cannot create xdefine: $!\n"; |
6820
|
|
|
|
|
|
|
+ open(XDEFINE, '>', 'xdefine') or die "$0: Cannot create xdefine: $!\n"; |
6821
|
|
|
|
|
|
|
close(XDEFINE); |
6822
|
|
|
|
|
|
|
} else { |
6823
|
|
|
|
|
|
|
init(); |
6824
|
|
|
|
|
|
|
diff --git a/dist/Time-HiRes/fallback/const-c.inc b/dist/Time-HiRes/fallback/const-c.inc |
6825
|
|
|
|
|
|
|
index a8626172af..524db169a9 100644 |
6826
|
|
|
|
|
|
|
--- dist/Time-HiRes/fallback/const-c.inc |
6827
|
|
|
|
|
|
|
+++ dist/Time-HiRes/fallback/const-c.inc |
6828
|
|
|
|
|
|
|
@@ -19,6 +19,7 @@ typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it. */ |
6829
|
|
|
|
|
|
|
#ifndef pTHX_ |
6830
|
|
|
|
|
|
|
#define pTHX_ /* 5.6 or later define this for threading support. */ |
6831
|
|
|
|
|
|
|
#endif |
6832
|
|
|
|
|
|
|
+ |
6833
|
|
|
|
|
|
|
static int |
6834
|
|
|
|
|
|
|
constant_11 (pTHX_ const char *name, IV *iv_return) { |
6835
|
|
|
|
|
|
|
/* When generated this function returned values for the list of names given |
6836
|
|
|
|
|
|
|
@@ -86,6 +87,51 @@ constant_11 (pTHX_ const char *name, IV *iv_return) { |
6837
|
|
|
|
|
|
|
return PERL_constant_NOTFOUND; |
6838
|
|
|
|
|
|
|
} |
6839
|
|
|
|
|
|
|
|
6840
|
|
|
|
|
|
|
+static int |
6841
|
|
|
|
|
|
|
+constant_13 (pTHX_ const char *name, IV *iv_return) { |
6842
|
|
|
|
|
|
|
+ /* When generated this function returned values for the list of names given |
6843
|
|
|
|
|
|
|
+ here. However, subsequent manual editing may have added or removed some. |
6844
|
|
|
|
|
|
|
+ CLOCK_HIGHRES TIMER_ABSTIME d_hires_utime */ |
6845
|
|
|
|
|
|
|
+ /* Offset 1 gives the best switch position. */ |
6846
|
|
|
|
|
|
|
+ switch (name[1]) { |
6847
|
|
|
|
|
|
|
+ case 'I': |
6848
|
|
|
|
|
|
|
+ if (memEQ(name, "TIMER_ABSTIME", 13)) { |
6849
|
|
|
|
|
|
|
+ /* ^ */ |
6850
|
|
|
|
|
|
|
+#ifdef TIMER_ABSTIME |
6851
|
|
|
|
|
|
|
+ *iv_return = TIMER_ABSTIME; |
6852
|
|
|
|
|
|
|
+ return PERL_constant_ISIV; |
6853
|
|
|
|
|
|
|
+#else |
6854
|
|
|
|
|
|
|
+ return PERL_constant_NOTDEF; |
6855
|
|
|
|
|
|
|
+#endif |
6856
|
|
|
|
|
|
|
+ } |
6857
|
|
|
|
|
|
|
+ break; |
6858
|
|
|
|
|
|
|
+ case 'L': |
6859
|
|
|
|
|
|
|
+ if (memEQ(name, "CLOCK_HIGHRES", 13)) { |
6860
|
|
|
|
|
|
|
+ /* ^ */ |
6861
|
|
|
|
|
|
|
+#ifdef CLOCK_HIGHRES |
6862
|
|
|
|
|
|
|
+ *iv_return = CLOCK_HIGHRES; |
6863
|
|
|
|
|
|
|
+ return PERL_constant_ISIV; |
6864
|
|
|
|
|
|
|
+#else |
6865
|
|
|
|
|
|
|
+ return PERL_constant_NOTDEF; |
6866
|
|
|
|
|
|
|
+#endif |
6867
|
|
|
|
|
|
|
+ } |
6868
|
|
|
|
|
|
|
+ break; |
6869
|
|
|
|
|
|
|
+ case '_': |
6870
|
|
|
|
|
|
|
+ if (memEQ(name, "d_hires_utime", 13)) { |
6871
|
|
|
|
|
|
|
+ /* ^ */ |
6872
|
|
|
|
|
|
|
+#ifdef TIME_HIRES_UTIME |
6873
|
|
|
|
|
|
|
+ *iv_return = 1; |
6874
|
|
|
|
|
|
|
+ return PERL_constant_ISIV; |
6875
|
|
|
|
|
|
|
+#else |
6876
|
|
|
|
|
|
|
+ *iv_return = 0; |
6877
|
|
|
|
|
|
|
+ return PERL_constant_ISIV; |
6878
|
|
|
|
|
|
|
+#endif |
6879
|
|
|
|
|
|
|
+ } |
6880
|
|
|
|
|
|
|
+ break; |
6881
|
|
|
|
|
|
|
+ } |
6882
|
|
|
|
|
|
|
+ return PERL_constant_NOTFOUND; |
6883
|
|
|
|
|
|
|
+} |
6884
|
|
|
|
|
|
|
+ |
6885
|
|
|
|
|
|
|
static int |
6886
|
|
|
|
|
|
|
constant_14 (pTHX_ const char *name, IV *iv_return) { |
6887
|
|
|
|
|
|
|
/* When generated this function returned values for the list of names given |
6888
|
|
|
|
|
|
|
@@ -250,16 +296,17 @@ my @names = (qw(CLOCKS_PER_SEC CLOCK_HIGHRES CLOCK_MONOTONIC |
6889
|
|
|
|
|
|
|
{name=>"d_getitimer", type=>"IV", macro=>"HAS_GETITIMER", value=>"1", default=>["IV", "0"]}, |
6890
|
|
|
|
|
|
|
{name=>"d_gettimeofday", type=>"IV", macro=>"HAS_GETTIMEOFDAY", value=>"1", default=>["IV", "0"]}, |
6891
|
|
|
|
|
|
|
{name=>"d_hires_stat", type=>"IV", macro=>"TIME_HIRES_STAT", value=>"1", default=>["IV", "0"]}, |
6892
|
|
|
|
|
|
|
+ {name=>"d_hires_utime", type=>"IV", macro=>"TIME_HIRES_UTIME", value=>"1", default=>["IV", "0"]}, |
6893
|
|
|
|
|
|
|
{name=>"d_nanosleep", type=>"IV", macro=>"TIME_HIRES_NANOSLEEP", value=>"1", default=>["IV", "0"]}, |
6894
|
|
|
|
|
|
|
{name=>"d_setitimer", type=>"IV", macro=>"HAS_SETITIMER", value=>"1", default=>["IV", "0"]}, |
6895
|
|
|
|
|
|
|
{name=>"d_ualarm", type=>"IV", macro=>"HAS_UALARM", value=>"1", default=>["IV", "0"]}, |
6896
|
|
|
|
|
|
|
{name=>"d_usleep", type=>"IV", macro=>"HAS_USLEEP", value=>"1", default=>["IV", "0"]}); |
6897
|
|
|
|
|
|
|
|
6898
|
|
|
|
|
|
|
-print constant_types(); # macro defs |
6899
|
|
|
|
|
|
|
+print constant_types(), "\n"; # macro defs |
6900
|
|
|
|
|
|
|
foreach (C_constant ("Time::HiRes", 'constant', 'IV', $types, undef, 3, @names) ) { |
6901
|
|
|
|
|
|
|
print $_, "\n"; # C constant subs |
6902
|
|
|
|
|
|
|
} |
6903
|
|
|
|
|
|
|
-print "#### XS Section:\n"; |
6904
|
|
|
|
|
|
|
+print "\n#### XS Section:\n"; |
6905
|
|
|
|
|
|
|
print XS_constant ("Time::HiRes", $types); |
6906
|
|
|
|
|
|
|
__END__ |
6907
|
|
|
|
|
|
|
*/ |
6908
|
|
|
|
|
|
|
@@ -322,33 +369,7 @@ __END__ |
6909
|
|
|
|
|
|
|
} |
6910
|
|
|
|
|
|
|
break; |
6911
|
|
|
|
|
|
|
case 13: |
6912
|
|
|
|
|
|
|
- /* Names all of length 13. */ |
6913
|
|
|
|
|
|
|
- /* CLOCK_HIGHRES TIMER_ABSTIME */ |
6914
|
|
|
|
|
|
|
- /* Offset 2 gives the best switch position. */ |
6915
|
|
|
|
|
|
|
- switch (name[2]) { |
6916
|
|
|
|
|
|
|
- case 'M': |
6917
|
|
|
|
|
|
|
- if (memEQ(name, "TIMER_ABSTIME", 13)) { |
6918
|
|
|
|
|
|
|
- /* ^ */ |
6919
|
|
|
|
|
|
|
-#ifdef TIMER_ABSTIME |
6920
|
|
|
|
|
|
|
- *iv_return = TIMER_ABSTIME; |
6921
|
|
|
|
|
|
|
- return PERL_constant_ISIV; |
6922
|
|
|
|
|
|
|
-#else |
6923
|
|
|
|
|
|
|
- return PERL_constant_NOTDEF; |
6924
|
|
|
|
|
|
|
-#endif |
6925
|
|
|
|
|
|
|
- } |
6926
|
|
|
|
|
|
|
- break; |
6927
|
|
|
|
|
|
|
- case 'O': |
6928
|
|
|
|
|
|
|
- if (memEQ(name, "CLOCK_HIGHRES", 13)) { |
6929
|
|
|
|
|
|
|
- /* ^ */ |
6930
|
|
|
|
|
|
|
-#ifdef CLOCK_HIGHRES |
6931
|
|
|
|
|
|
|
- *iv_return = CLOCK_HIGHRES; |
6932
|
|
|
|
|
|
|
- return PERL_constant_ISIV; |
6933
|
|
|
|
|
|
|
-#else |
6934
|
|
|
|
|
|
|
- return PERL_constant_NOTDEF; |
6935
|
|
|
|
|
|
|
-#endif |
6936
|
|
|
|
|
|
|
- } |
6937
|
|
|
|
|
|
|
- break; |
6938
|
|
|
|
|
|
|
- } |
6939
|
|
|
|
|
|
|
+ return constant_13 (aTHX_ name, iv_return); |
6940
|
|
|
|
|
|
|
break; |
6941
|
|
|
|
|
|
|
case 14: |
6942
|
|
|
|
|
|
|
return constant_14 (aTHX_ name, iv_return); |
6943
|
|
|
|
|
|
|
diff --git a/dist/Time-HiRes/t/Watchdog.pm b/dist/Time-HiRes/t/Watchdog.pm |
6944
|
|
|
|
|
|
|
index 83e854396f..44ec8081de 100644 |
6945
|
|
|
|
|
|
|
--- dist/Time-HiRes/t/Watchdog.pm |
6946
|
|
|
|
|
|
|
+++ dist/Time-HiRes/t/Watchdog.pm |
6947
|
|
|
|
|
|
|
@@ -10,44 +10,44 @@ my $watchdog_pid; |
6948
|
|
|
|
|
|
|
my $TheEnd; |
6949
|
|
|
|
|
|
|
|
6950
|
|
|
|
|
|
|
if ($Config{d_fork}) { |
6951
|
|
|
|
|
|
|
- note "I am the main process $$, starting the watchdog process..."; |
6952
|
|
|
|
|
|
|
+ print("# I am the main process $$, starting the watchdog process...\n"); |
6953
|
|
|
|
|
|
|
$watchdog_pid = fork(); |
6954
|
|
|
|
|
|
|
if (defined $watchdog_pid) { |
6955
|
|
|
|
|
|
|
if ($watchdog_pid == 0) { # We are the kid, set up the watchdog. |
6956
|
|
|
|
|
|
|
my $ppid = getppid(); |
6957
|
|
|
|
|
|
|
- note "I am the watchdog process $$, sleeping for $waitfor seconds..."; |
6958
|
|
|
|
|
|
|
+ print("# I am the watchdog process $$, sleeping for $waitfor seconds...\n"); |
6959
|
|
|
|
|
|
|
sleep($waitfor - 2); # Workaround for perlbug #49073 |
6960
|
|
|
|
|
|
|
sleep(2); # Wait for parent to exit |
6961
|
|
|
|
|
|
|
if (kill(0, $ppid)) { # Check if parent still exists |
6962
|
|
|
|
|
|
|
warn "\n$0: overall time allowed for tests (${waitfor}s) exceeded!\n"; |
6963
|
|
|
|
|
|
|
- note "Terminating main process $ppid..."; |
6964
|
|
|
|
|
|
|
+ print("Terminating main process $ppid...\n"); |
6965
|
|
|
|
|
|
|
kill('KILL', $ppid); |
6966
|
|
|
|
|
|
|
- note "This is the watchdog process $$, over and out."; |
6967
|
|
|
|
|
|
|
+ print("# This is the watchdog process $$, over and out.\n"); |
6968
|
|
|
|
|
|
|
} |
6969
|
|
|
|
|
|
|
exit(0); |
6970
|
|
|
|
|
|
|
} else { |
6971
|
|
|
|
|
|
|
- note "The watchdog process $watchdog_pid launched, continuing testing..."; |
6972
|
|
|
|
|
|
|
+ print("# The watchdog process $watchdog_pid launched, continuing testing...\n"); |
6973
|
|
|
|
|
|
|
$TheEnd = time() + $waitfor; |
6974
|
|
|
|
|
|
|
} |
6975
|
|
|
|
|
|
|
} else { |
6976
|
|
|
|
|
|
|
warn "$0: fork failed: $!\n"; |
6977
|
|
|
|
|
|
|
} |
6978
|
|
|
|
|
|
|
} else { |
6979
|
|
|
|
|
|
|
- note "No watchdog process (need fork)"; |
6980
|
|
|
|
|
|
|
+ print("# No watchdog process (need fork)\n"); |
6981
|
|
|
|
|
|
|
} |
6982
|
|
|
|
|
|
|
|
6983
|
|
|
|
|
|
|
END { |
6984
|
|
|
|
|
|
|
if ($watchdog_pid) { # Only in the main process. |
6985
|
|
|
|
|
|
|
my $left = $TheEnd - time(); |
6986
|
|
|
|
|
|
|
- note sprintf "I am the main process $$, terminating the watchdog process $watchdog_pid before it terminates me in %d seconds (testing took %d seconds).", $left, $waitfor - $left; |
6987
|
|
|
|
|
|
|
+ printf("# I am the main process $$, terminating the watchdog process $watchdog_pid before it terminates me in %d seconds (testing took %d seconds).\n", $left, $waitfor - $left); |
6988
|
|
|
|
|
|
|
if (kill(0, $watchdog_pid)) { |
6989
|
|
|
|
|
|
|
local $? = 0; |
6990
|
|
|
|
|
|
|
my $kill = kill('KILL', $watchdog_pid); # We are done, the watchdog can go. |
6991
|
|
|
|
|
|
|
wait(); |
6992
|
|
|
|
|
|
|
- note sprintf "kill KILL $watchdog_pid = %d", $kill; |
6993
|
|
|
|
|
|
|
+ printf("# kill KILL $watchdog_pid = %d\n", $kill); |
6994
|
|
|
|
|
|
|
} |
6995
|
|
|
|
|
|
|
unlink("ktrace.out"); # Used in BSD system call tracing. |
6996
|
|
|
|
|
|
|
- note "All done."; |
6997
|
|
|
|
|
|
|
+ print("# All done.\n"); |
6998
|
|
|
|
|
|
|
} |
6999
|
|
|
|
|
|
|
} |
7000
|
|
|
|
|
|
|
|
7001
|
|
|
|
|
|
|
diff --git a/dist/Time-HiRes/t/alarm.t b/dist/Time-HiRes/t/alarm.t |
7002
|
|
|
|
|
|
|
index 841694f67c..4935410d36 100644 |
7003
|
|
|
|
|
|
|
--- dist/Time-HiRes/t/alarm.t |
7004
|
|
|
|
|
|
|
+++ dist/Time-HiRes/t/alarm.t |
7005
|
|
|
|
|
|
|
@@ -1,6 +1,6 @@ |
7006
|
|
|
|
|
|
|
use strict; |
7007
|
|
|
|
|
|
|
|
7008
|
|
|
|
|
|
|
-use Test::More 0.82 tests => 10; |
7009
|
|
|
|
|
|
|
+use Test::More tests => 10; |
7010
|
|
|
|
|
|
|
use t::Watchdog; |
7011
|
|
|
|
|
|
|
|
7012
|
|
|
|
|
|
|
BEGIN { require_ok "Time::HiRes"; } |
7013
|
|
|
|
|
|
|
@@ -10,7 +10,7 @@ use Config; |
7014
|
|
|
|
|
|
|
my $limit = 0.25; # 25% is acceptable slosh for testing timers |
7015
|
|
|
|
|
|
|
|
7016
|
|
|
|
|
|
|
my $xdefine = ''; |
7017
|
|
|
|
|
|
|
-if (open(XDEFINE, "xdefine")) { |
7018
|
|
|
|
|
|
|
+if (open(XDEFINE, "<", "xdefine")) { |
7019
|
|
|
|
|
|
|
chomp($xdefine = || ""); |
7020
|
|
|
|
|
|
|
close(XDEFINE); |
7021
|
|
|
|
|
|
|
} |
7022
|
|
|
|
|
|
|
@@ -29,12 +29,14 @@ SKIP: { |
7023
|
|
|
|
|
|
|
|
7024
|
|
|
|
|
|
|
my ($r, $i, $not, $ok); |
7025
|
|
|
|
|
|
|
|
7026
|
|
|
|
|
|
|
+ $not = ""; |
7027
|
|
|
|
|
|
|
+ |
7028
|
|
|
|
|
|
|
$r = [Time::HiRes::gettimeofday()]; |
7029
|
|
|
|
|
|
|
$i = 5; |
7030
|
|
|
|
|
|
|
my $oldaction; |
7031
|
|
|
|
|
|
|
if ($use_sigaction) { |
7032
|
|
|
|
|
|
|
$oldaction = new POSIX::SigAction; |
7033
|
|
|
|
|
|
|
- note sprintf "sigaction tick, ALRM = %d", &POSIX::SIGALRM; |
7034
|
|
|
|
|
|
|
+ printf("# sigaction tick, ALRM = %d\n", &POSIX::SIGALRM); |
7035
|
|
|
|
|
|
|
|
7036
|
|
|
|
|
|
|
# Perl's deferred signals may be too wimpy to break through |
7037
|
|
|
|
|
|
|
# a restartable select(), so use POSIX::sigaction if available. |
7038
|
|
|
|
|
|
|
@@ -44,7 +46,7 @@ SKIP: { |
7039
|
|
|
|
|
|
|
$oldaction) |
7040
|
|
|
|
|
|
|
or die "Error setting SIGALRM handler with sigaction: $!\n"; |
7041
|
|
|
|
|
|
|
} else { |
7042
|
|
|
|
|
|
|
- note "SIG tick"; |
7043
|
|
|
|
|
|
|
+ print("# SIG tick\n"); |
7044
|
|
|
|
|
|
|
$SIG{ALRM} = "tick"; |
7045
|
|
|
|
|
|
|
} |
7046
|
|
|
|
|
|
|
|
7047
|
|
|
|
|
|
|
@@ -56,8 +58,8 @@ SKIP: { |
7048
|
|
|
|
|
|
|
Time::HiRes::alarm(0.3); |
7049
|
|
|
|
|
|
|
select (undef, undef, undef, 3); |
7050
|
|
|
|
|
|
|
my $ival = Time::HiRes::tv_interval ($r); |
7051
|
|
|
|
|
|
|
- note "Select returned! $i $ival"; |
7052
|
|
|
|
|
|
|
- note abs($ival/3 - 1); |
7053
|
|
|
|
|
|
|
+ print("# Select returned! $i $ival\n"); |
7054
|
|
|
|
|
|
|
+ printf("# %s\n", abs($ival/3 - 1)); |
7055
|
|
|
|
|
|
|
# Whether select() gets restarted after signals is |
7056
|
|
|
|
|
|
|
# implementation dependent. If it is restarted, we |
7057
|
|
|
|
|
|
|
# will get about 3.3 seconds: 3 from the select, 0.3 |
7058
|
|
|
|
|
|
|
@@ -86,7 +88,7 @@ SKIP: { |
7059
|
|
|
|
|
|
|
sub tick { |
7060
|
|
|
|
|
|
|
$i--; |
7061
|
|
|
|
|
|
|
my $ival = Time::HiRes::tv_interval ($r); |
7062
|
|
|
|
|
|
|
- note "Tick! $i $ival"; |
7063
|
|
|
|
|
|
|
+ print("# Tick! $i $ival\n"); |
7064
|
|
|
|
|
|
|
my $exp = 0.3 * (5 - $i); |
7065
|
|
|
|
|
|
|
if ($exp == 0) { |
7066
|
|
|
|
|
|
|
$not = "tick: divisor became zero"; |
7067
|
|
|
|
|
|
|
@@ -106,8 +108,8 @@ SKIP: { |
7068
|
|
|
|
|
|
|
Time::HiRes::alarm(0); # can't cancel usig %SIG |
7069
|
|
|
|
|
|
|
} |
7070
|
|
|
|
|
|
|
|
7071
|
|
|
|
|
|
|
+ print("# $not\n"); |
7072
|
|
|
|
|
|
|
ok !$not; |
7073
|
|
|
|
|
|
|
- note $not || $ok; |
7074
|
|
|
|
|
|
|
} |
7075
|
|
|
|
|
|
|
|
7076
|
|
|
|
|
|
|
SKIP: { |
7077
|
|
|
|
|
|
|
@@ -126,7 +128,7 @@ SKIP: { |
7078
|
|
|
|
|
|
|
# http://groups.google.com/group/perl.perl5.porters/browse_thread/thread/adaffaaf939b042e/20dafc298df737f0%2320dafc298df737f0?sa=X&oi=groupsr&start=0&num=3 |
7079
|
|
|
|
|
|
|
# Perl changes [18765] and [18770], perl bug [perl #20920] |
7080
|
|
|
|
|
|
|
|
7081
|
|
|
|
|
|
|
- note "Finding delay loop..."; |
7082
|
|
|
|
|
|
|
+ print("# Finding delay loop...\n"); |
7083
|
|
|
|
|
|
|
|
7084
|
|
|
|
|
|
|
my $T = 0.01; |
7085
|
|
|
|
|
|
|
my $DelayN = 1024; |
7086
|
|
|
|
|
|
|
@@ -137,7 +139,7 @@ SKIP: { |
7087
|
|
|
|
|
|
|
for ($i = 0; $i < $DelayN; $i++) { } |
7088
|
|
|
|
|
|
|
my $t1 = Time::HiRes::time(); |
7089
|
|
|
|
|
|
|
my $dt = $t1 - $t0; |
7090
|
|
|
|
|
|
|
- note "N = $DelayN, t1 = $t1, t0 = $t0, dt = $dt"; |
7091
|
|
|
|
|
|
|
+ print("# N = $DelayN, t1 = $t1, t0 = $t0, dt = $dt\n"); |
7092
|
|
|
|
|
|
|
last N if $dt > $T; |
7093
|
|
|
|
|
|
|
$DelayN *= 2; |
7094
|
|
|
|
|
|
|
} while (1); |
7095
|
|
|
|
|
|
|
@@ -169,7 +171,7 @@ SKIP: { |
7096
|
|
|
|
|
|
|
|
7097
|
|
|
|
|
|
|
$SIG{ALRM} = sub { |
7098
|
|
|
|
|
|
|
$a++; |
7099
|
|
|
|
|
|
|
- note "Alarm $a - ", Time::HiRes::time(); |
7100
|
|
|
|
|
|
|
+ printf("# Alarm $a - %s\n", Time::HiRes::time()); |
7101
|
|
|
|
|
|
|
Time::HiRes::alarm(0) if $a >= $A; # Disarm the alarm. |
7102
|
|
|
|
|
|
|
$Delay->(2); # Try burning CPU at least for 2T seconds. |
7103
|
|
|
|
|
|
|
}; |
7104
|
|
|
|
|
|
|
@@ -204,18 +206,18 @@ SKIP: { |
7105
|
|
|
|
|
|
|
my $alrm = 0; |
7106
|
|
|
|
|
|
|
$SIG{ALRM} = sub { $alrm++ }; |
7107
|
|
|
|
|
|
|
my $got = Time::HiRes::alarm(2.7); |
7108
|
|
|
|
|
|
|
- ok $got == 0 or note $got; |
7109
|
|
|
|
|
|
|
+ ok $got == 0 or print("# $got\n"); |
7110
|
|
|
|
|
|
|
|
7111
|
|
|
|
|
|
|
my $t0 = Time::HiRes::time(); |
7112
|
|
|
|
|
|
|
1 while Time::HiRes::time() - $t0 <= 1; |
7113
|
|
|
|
|
|
|
|
7114
|
|
|
|
|
|
|
$got = Time::HiRes::alarm(0); |
7115
|
|
|
|
|
|
|
- ok $got > 0 && $got < 1.8 or note $got; |
7116
|
|
|
|
|
|
|
+ ok $got > 0 && $got < 1.8 or print("# $got\n"); |
7117
|
|
|
|
|
|
|
|
7118
|
|
|
|
|
|
|
- ok $alrm == 0 or note $alrm; |
7119
|
|
|
|
|
|
|
+ ok $alrm == 0 or print("# $alrm\n"); |
7120
|
|
|
|
|
|
|
|
7121
|
|
|
|
|
|
|
$got = Time::HiRes::alarm(0); |
7122
|
|
|
|
|
|
|
- ok $got == 0 or note $got; |
7123
|
|
|
|
|
|
|
+ ok $got == 0 or print("# $got\n"); |
7124
|
|
|
|
|
|
|
} |
7125
|
|
|
|
|
|
|
} |
7126
|
|
|
|
|
|
|
|
7127
|
|
|
|
|
|
|
diff --git a/dist/Time-HiRes/t/clock.t b/dist/Time-HiRes/t/clock.t |
7128
|
|
|
|
|
|
|
index 6d11dd2ca0..346ca57fbf 100644 |
7129
|
|
|
|
|
|
|
--- dist/Time-HiRes/t/clock.t |
7130
|
|
|
|
|
|
|
+++ dist/Time-HiRes/t/clock.t |
7131
|
|
|
|
|
|
|
@@ -1,6 +1,6 @@ |
7132
|
|
|
|
|
|
|
use strict; |
7133
|
|
|
|
|
|
|
|
7134
|
|
|
|
|
|
|
-use Test::More 0.82 tests => 5; |
7135
|
|
|
|
|
|
|
+use Test::More tests => 5; |
7136
|
|
|
|
|
|
|
use t::Watchdog; |
7137
|
|
|
|
|
|
|
|
7138
|
|
|
|
|
|
|
BEGIN { require_ok "Time::HiRes"; } |
7139
|
|
|
|
|
|
|
@@ -13,10 +13,10 @@ sub has_symbol { |
7140
|
|
|
|
|
|
|
return $@ eq ''; |
7141
|
|
|
|
|
|
|
} |
7142
|
|
|
|
|
|
|
|
7143
|
|
|
|
|
|
|
-note sprintf "have_clock_gettime = %d", &Time::HiRes::d_clock_gettime; |
7144
|
|
|
|
|
|
|
-note sprintf "have_clock_getres = %d", &Time::HiRes::d_clock_getres; |
7145
|
|
|
|
|
|
|
-note sprintf "have_clock_nanosleep = %d", &Time::HiRes::d_clock_nanosleep; |
7146
|
|
|
|
|
|
|
-note sprintf "have_clock = %d", &Time::HiRes::d_clock; |
7147
|
|
|
|
|
|
|
+printf("# have_clock_gettime = %d\n", &Time::HiRes::d_clock_gettime); |
7148
|
|
|
|
|
|
|
+printf("# have_clock_getres = %d\n", &Time::HiRes::d_clock_getres); |
7149
|
|
|
|
|
|
|
+printf("# have_clock_nanosleep = %d\n", &Time::HiRes::d_clock_nanosleep); |
7150
|
|
|
|
|
|
|
+printf("# have_clock = %d\n", &Time::HiRes::d_clock); |
7151
|
|
|
|
|
|
|
|
7152
|
|
|
|
|
|
|
# Ideally, we'd like to test that the timers are rather precise. |
7153
|
|
|
|
|
|
|
# However, if the system is busy, there are no guarantees on how |
7154
|
|
|
|
|
|
|
@@ -36,25 +36,25 @@ SKIP: { |
7155
|
|
|
|
|
|
|
my $ok = 0; |
7156
|
|
|
|
|
|
|
TRY: { |
7157
|
|
|
|
|
|
|
for my $try (1..3) { |
7158
|
|
|
|
|
|
|
- note "CLOCK_REALTIME: try = $try"; |
7159
|
|
|
|
|
|
|
+ print("# CLOCK_REALTIME: try = $try\n"); |
7160
|
|
|
|
|
|
|
my $t0 = Time::HiRes::clock_gettime(&CLOCK_REALTIME); |
7161
|
|
|
|
|
|
|
my $T = 1.5; |
7162
|
|
|
|
|
|
|
Time::HiRes::sleep($T); |
7163
|
|
|
|
|
|
|
my $t1 = Time::HiRes::clock_gettime(&CLOCK_REALTIME); |
7164
|
|
|
|
|
|
|
if ($t0 > 0 && $t1 > $t0) { |
7165
|
|
|
|
|
|
|
- note "t1 = $t1, t0 = $t0"; |
7166
|
|
|
|
|
|
|
+ print("# t1 = $t1, t0 = $t0\n"); |
7167
|
|
|
|
|
|
|
my $dt = $t1 - $t0; |
7168
|
|
|
|
|
|
|
my $rt = abs(1 - $dt / $T); |
7169
|
|
|
|
|
|
|
- note "dt = $dt, rt = $rt"; |
7170
|
|
|
|
|
|
|
+ print("# dt = $dt, rt = $rt\n"); |
7171
|
|
|
|
|
|
|
if ($rt <= 2 * $limit) { |
7172
|
|
|
|
|
|
|
$ok = 1; |
7173
|
|
|
|
|
|
|
last TRY; |
7174
|
|
|
|
|
|
|
} |
7175
|
|
|
|
|
|
|
} else { |
7176
|
|
|
|
|
|
|
- note "Error: t0 = $t0, t1 = $t1"; |
7177
|
|
|
|
|
|
|
+ print("# Error: t0 = $t0, t1 = $t1\n"); |
7178
|
|
|
|
|
|
|
} |
7179
|
|
|
|
|
|
|
my $r = rand() + rand(); |
7180
|
|
|
|
|
|
|
- note sprintf "Sleeping for %.6f seconds...\n", $r; |
7181
|
|
|
|
|
|
|
+ printf("# Sleeping for %.6f seconds...\n", $r); |
7182
|
|
|
|
|
|
|
Time::HiRes::sleep($r); |
7183
|
|
|
|
|
|
|
} |
7184
|
|
|
|
|
|
|
} |
7185
|
|
|
|
|
|
|
@@ -64,7 +64,7 @@ SKIP: { |
7186
|
|
|
|
|
|
|
SKIP: { |
7187
|
|
|
|
|
|
|
skip "no clock_getres", 1 unless &Time::HiRes::d_clock_getres; |
7188
|
|
|
|
|
|
|
my $tr = Time::HiRes::clock_getres(); |
7189
|
|
|
|
|
|
|
- ok $tr > 0 or note "tr = $tr"; |
7190
|
|
|
|
|
|
|
+ ok $tr > 0 or print("# tr = $tr\n"); |
7191
|
|
|
|
|
|
|
} |
7192
|
|
|
|
|
|
|
|
7193
|
|
|
|
|
|
|
SKIP: { |
7194
|
|
|
|
|
|
|
@@ -73,17 +73,17 @@ SKIP: { |
7195
|
|
|
|
|
|
|
my $s = 1.5e9; |
7196
|
|
|
|
|
|
|
my $t = Time::HiRes::clock_nanosleep(&CLOCK_REALTIME, $s); |
7197
|
|
|
|
|
|
|
my $r = abs(1 - $t / $s); |
7198
|
|
|
|
|
|
|
- ok $r < 2 * $limit or note "t = $t, r = $r"; |
7199
|
|
|
|
|
|
|
+ ok $r < 2 * $limit or print("# t = $t, r = $r\n"); |
7200
|
|
|
|
|
|
|
} |
7201
|
|
|
|
|
|
|
|
7202
|
|
|
|
|
|
|
SKIP: { |
7203
|
|
|
|
|
|
|
skip "no clock", 1 unless &Time::HiRes::d_clock; |
7204
|
|
|
|
|
|
|
my @clock = Time::HiRes::clock(); |
7205
|
|
|
|
|
|
|
- note "clock = @clock"; |
7206
|
|
|
|
|
|
|
+ print("# clock = @clock\n"); |
7207
|
|
|
|
|
|
|
for my $i (1..3) { |
7208
|
|
|
|
|
|
|
for (my $j = 0; $j < 1e6; $j++) { } |
7209
|
|
|
|
|
|
|
push @clock, Time::HiRes::clock(); |
7210
|
|
|
|
|
|
|
- note "clock = @clock"; |
7211
|
|
|
|
|
|
|
+ print("# clock = @clock\n"); |
7212
|
|
|
|
|
|
|
} |
7213
|
|
|
|
|
|
|
ok $clock[0] >= 0 && |
7214
|
|
|
|
|
|
|
$clock[1] > $clock[0] && |
7215
|
|
|
|
|
|
|
diff --git a/dist/Time-HiRes/t/gettimeofday.t b/dist/Time-HiRes/t/gettimeofday.t |
7216
|
|
|
|
|
|
|
index 8f7c5f3039..69defe8672 100644 |
7217
|
|
|
|
|
|
|
--- dist/Time-HiRes/t/gettimeofday.t |
7218
|
|
|
|
|
|
|
+++ dist/Time-HiRes/t/gettimeofday.t |
7219
|
|
|
|
|
|
|
@@ -8,26 +8,26 @@ BEGIN { |
7220
|
|
|
|
|
|
|
} |
7221
|
|
|
|
|
|
|
} |
7222
|
|
|
|
|
|
|
|
7223
|
|
|
|
|
|
|
-use Test::More 0.82 tests => 6; |
7224
|
|
|
|
|
|
|
+use Test::More tests => 6; |
7225
|
|
|
|
|
|
|
use t::Watchdog; |
7226
|
|
|
|
|
|
|
|
7227
|
|
|
|
|
|
|
my @one = Time::HiRes::gettimeofday(); |
7228
|
|
|
|
|
|
|
-note 'gettimeofday returned ', 0+@one, ' args'; |
7229
|
|
|
|
|
|
|
+printf("# gettimeofday returned %d args\n", 0+@one); |
7230
|
|
|
|
|
|
|
ok @one == 2; |
7231
|
|
|
|
|
|
|
-ok $one[0] > 850_000_000 or note "@one too small"; |
7232
|
|
|
|
|
|
|
+ok $one[0] > 850_000_000 or print("# @one too small\n"); |
7233
|
|
|
|
|
|
|
|
7234
|
|
|
|
|
|
|
sleep 1; |
7235
|
|
|
|
|
|
|
|
7236
|
|
|
|
|
|
|
my @two = Time::HiRes::gettimeofday(); |
7237
|
|
|
|
|
|
|
ok $two[0] > $one[0] || ($two[0] == $one[0] && $two[1] > $one[1]) |
7238
|
|
|
|
|
|
|
- or note "@two is not greater than @one"; |
7239
|
|
|
|
|
|
|
+ or print("# @two is not greater than @one\n"); |
7240
|
|
|
|
|
|
|
|
7241
|
|
|
|
|
|
|
my $f = Time::HiRes::time(); |
7242
|
|
|
|
|
|
|
-ok $f > 850_000_000 or note "$f too small"; |
7243
|
|
|
|
|
|
|
-ok $f - $two[0] < 2 or note "$f - $two[0] >= 2"; |
7244
|
|
|
|
|
|
|
+ok $f > 850_000_000 or print("# $f too small\n"); |
7245
|
|
|
|
|
|
|
+ok $f - $two[0] < 2 or print("# $f - $two[0] >= 2\n"); |
7246
|
|
|
|
|
|
|
|
7247
|
|
|
|
|
|
|
my $r = [Time::HiRes::gettimeofday()]; |
7248
|
|
|
|
|
|
|
my $g = Time::HiRes::tv_interval $r; |
7249
|
|
|
|
|
|
|
-ok $g < 2 or note $g; |
7250
|
|
|
|
|
|
|
+ok $g < 2 or print("# $g\n"); |
7251
|
|
|
|
|
|
|
|
7252
|
|
|
|
|
|
|
1; |
7253
|
|
|
|
|
|
|
diff --git a/dist/Time-HiRes/t/itimer.t b/dist/Time-HiRes/t/itimer.t |
7254
|
|
|
|
|
|
|
index 9eb2b93f6f..31cdd674ae 100644 |
7255
|
|
|
|
|
|
|
--- dist/Time-HiRes/t/itimer.t |
7256
|
|
|
|
|
|
|
+++ dist/Time-HiRes/t/itimer.t |
7257
|
|
|
|
|
|
|
@@ -25,7 +25,7 @@ BEGIN { |
7258
|
|
|
|
|
|
|
} |
7259
|
|
|
|
|
|
|
} |
7260
|
|
|
|
|
|
|
|
7261
|
|
|
|
|
|
|
-use Test::More 0.82 tests => 2; |
7262
|
|
|
|
|
|
|
+use Test::More tests => 2; |
7263
|
|
|
|
|
|
|
use t::Watchdog; |
7264
|
|
|
|
|
|
|
|
7265
|
|
|
|
|
|
|
my $limit = 0.25; # 25% is acceptable slosh for testing timers |
7266
|
|
|
|
|
|
|
@@ -35,11 +35,11 @@ my $r = [Time::HiRes::gettimeofday()]; |
7267
|
|
|
|
|
|
|
|
7268
|
|
|
|
|
|
|
$SIG{VTALRM} = sub { |
7269
|
|
|
|
|
|
|
$i ? $i-- : Time::HiRes::setitimer(&Time::HiRes::ITIMER_VIRTUAL, 0); |
7270
|
|
|
|
|
|
|
- note "Tick! $i ", Time::HiRes::tv_interval($r); |
7271
|
|
|
|
|
|
|
+ printf("# Tick! $i %s\n", Time::HiRes::tv_interval($r)); |
7272
|
|
|
|
|
|
|
}; |
7273
|
|
|
|
|
|
|
|
7274
|
|
|
|
|
|
|
-note "setitimer: ", join(" ", |
7275
|
|
|
|
|
|
|
- Time::HiRes::setitimer(&Time::HiRes::ITIMER_VIRTUAL, 0.5, 0.4)); |
7276
|
|
|
|
|
|
|
+printf("# setitimer: %s\n", join(" ", |
7277
|
|
|
|
|
|
|
+ Time::HiRes::setitimer(&Time::HiRes::ITIMER_VIRTUAL, 0.5, 0.4))); |
7278
|
|
|
|
|
|
|
|
7279
|
|
|
|
|
|
|
# Assume interval timer granularity of $limit * 0.5 seconds. Too bold? |
7280
|
|
|
|
|
|
|
my $virt = Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL); |
7281
|
|
|
|
|
|
|
@@ -47,19 +47,19 @@ ok(defined $virt && abs($virt / 0.5) - 1 < $limit, |
7282
|
|
|
|
|
|
|
"ITIMER_VIRTUAL defined with sufficient granularity") |
7283
|
|
|
|
|
|
|
or diag "virt=" . (defined $virt ? $virt : 'undef'); |
7284
|
|
|
|
|
|
|
|
7285
|
|
|
|
|
|
|
-note "getitimer: ", join(" ", |
7286
|
|
|
|
|
|
|
- Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL)); |
7287
|
|
|
|
|
|
|
+printf("# getitimer: %s\n", join(" ", |
7288
|
|
|
|
|
|
|
+ Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL))); |
7289
|
|
|
|
|
|
|
|
7290
|
|
|
|
|
|
|
while (Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL)) { |
7291
|
|
|
|
|
|
|
my $j; |
7292
|
|
|
|
|
|
|
for (1..1000) { $j++ } # Can't be unbreakable, must test getitimer(). |
7293
|
|
|
|
|
|
|
} |
7294
|
|
|
|
|
|
|
|
7295
|
|
|
|
|
|
|
-note "getitimer: ", join(" ", |
7296
|
|
|
|
|
|
|
- Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL)); |
7297
|
|
|
|
|
|
|
+printf("# getitimer: %s\n", join(" ", |
7298
|
|
|
|
|
|
|
+ Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL))); |
7299
|
|
|
|
|
|
|
|
7300
|
|
|
|
|
|
|
$virt = Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL); |
7301
|
|
|
|
|
|
|
-note "at end, i=$i"; |
7302
|
|
|
|
|
|
|
+print("# at end, i=$i\n"); |
7303
|
|
|
|
|
|
|
is($virt, 0, "time left should be zero"); |
7304
|
|
|
|
|
|
|
|
7305
|
|
|
|
|
|
|
$SIG{VTALRM} = 'DEFAULT'; |
7306
|
|
|
|
|
|
|
diff --git a/dist/Time-HiRes/t/nanosleep.t b/dist/Time-HiRes/t/nanosleep.t |
7307
|
|
|
|
|
|
|
index aef9db6163..c17a7e4790 100644 |
7308
|
|
|
|
|
|
|
--- dist/Time-HiRes/t/nanosleep.t |
7309
|
|
|
|
|
|
|
+++ dist/Time-HiRes/t/nanosleep.t |
7310
|
|
|
|
|
|
|
@@ -8,7 +8,7 @@ BEGIN { |
7311
|
|
|
|
|
|
|
} |
7312
|
|
|
|
|
|
|
} |
7313
|
|
|
|
|
|
|
|
7314
|
|
|
|
|
|
|
-use Test::More 0.82 tests => 3; |
7315
|
|
|
|
|
|
|
+use Test::More tests => 3; |
7316
|
|
|
|
|
|
|
use t::Watchdog; |
7317
|
|
|
|
|
|
|
|
7318
|
|
|
|
|
|
|
eval { Time::HiRes::nanosleep(-5) }; |
7319
|
|
|
|
|
|
|
@@ -21,7 +21,7 @@ my $two = CORE::time; |
7320
|
|
|
|
|
|
|
Time::HiRes::nanosleep(10_000_000); |
7321
|
|
|
|
|
|
|
my $three = CORE::time; |
7322
|
|
|
|
|
|
|
ok $one == $two || $two == $three |
7323
|
|
|
|
|
|
|
- or note "slept too long, $one $two $three"; |
7324
|
|
|
|
|
|
|
+ or print("# slept too long, $one $two $three\n"); |
7325
|
|
|
|
|
|
|
|
7326
|
|
|
|
|
|
|
SKIP: { |
7327
|
|
|
|
|
|
|
skip "no gettimeofday", 1 unless &Time::HiRes::d_gettimeofday; |
7328
|
|
|
|
|
|
|
@@ -29,7 +29,7 @@ SKIP: { |
7329
|
|
|
|
|
|
|
Time::HiRes::nanosleep(500_000_000); |
7330
|
|
|
|
|
|
|
my $f2 = Time::HiRes::time(); |
7331
|
|
|
|
|
|
|
my $d = $f2 - $f; |
7332
|
|
|
|
|
|
|
- ok $d > 0.4 && $d < 0.9 or note "slept $d secs $f to $f2"; |
7333
|
|
|
|
|
|
|
+ ok $d > 0.4 && $d < 0.9 or print("# slept $d secs $f to $f2\n"); |
7334
|
|
|
|
|
|
|
} |
7335
|
|
|
|
|
|
|
|
7336
|
|
|
|
|
|
|
1; |
7337
|
|
|
|
|
|
|
diff --git a/dist/Time-HiRes/t/sleep.t b/dist/Time-HiRes/t/sleep.t |
7338
|
|
|
|
|
|
|
index e7cc6271a8..b84b4c6725 100644 |
7339
|
|
|
|
|
|
|
--- dist/Time-HiRes/t/sleep.t |
7340
|
|
|
|
|
|
|
+++ dist/Time-HiRes/t/sleep.t |
7341
|
|
|
|
|
|
|
@@ -1,6 +1,6 @@ |
7342
|
|
|
|
|
|
|
use strict; |
7343
|
|
|
|
|
|
|
|
7344
|
|
|
|
|
|
|
-use Test::More 0.82 tests => 4; |
7345
|
|
|
|
|
|
|
+use Test::More tests => 4; |
7346
|
|
|
|
|
|
|
use t::Watchdog; |
7347
|
|
|
|
|
|
|
|
7348
|
|
|
|
|
|
|
BEGIN { require_ok "Time::HiRes"; } |
7349
|
|
|
|
|
|
|
@@ -8,7 +8,7 @@ BEGIN { require_ok "Time::HiRes"; } |
7350
|
|
|
|
|
|
|
use Config; |
7351
|
|
|
|
|
|
|
|
7352
|
|
|
|
|
|
|
my $xdefine = ''; |
7353
|
|
|
|
|
|
|
-if (open(XDEFINE, "xdefine")) { |
7354
|
|
|
|
|
|
|
+if (open(XDEFINE, "<", "xdefine")) { |
7355
|
|
|
|
|
|
|
chomp($xdefine = || ""); |
7356
|
|
|
|
|
|
|
close(XDEFINE); |
7357
|
|
|
|
|
|
|
} |
7358
|
|
|
|
|
|
|
@@ -26,12 +26,12 @@ like $@, qr/::sleep\(-1\): negative time not invented yet/, |
7359
|
|
|
|
|
|
|
SKIP: { |
7360
|
|
|
|
|
|
|
skip "no subsecond alarm", 2 unless $can_subsecond_alarm; |
7361
|
|
|
|
|
|
|
my $f = Time::HiRes::time; |
7362
|
|
|
|
|
|
|
- note "time...$f"; |
7363
|
|
|
|
|
|
|
+ print("# time...$f\n"); |
7364
|
|
|
|
|
|
|
ok 1; |
7365
|
|
|
|
|
|
|
|
7366
|
|
|
|
|
|
|
my $r = [Time::HiRes::gettimeofday()]; |
7367
|
|
|
|
|
|
|
Time::HiRes::sleep (0.5); |
7368
|
|
|
|
|
|
|
- note "sleep...", Time::HiRes::tv_interval($r); |
7369
|
|
|
|
|
|
|
+ printf("# sleep...%s\n", Time::HiRes::tv_interval($r)); |
7370
|
|
|
|
|
|
|
ok 1; |
7371
|
|
|
|
|
|
|
} |
7372
|
|
|
|
|
|
|
|
7373
|
|
|
|
|
|
|
diff --git a/dist/Time-HiRes/t/stat.t b/dist/Time-HiRes/t/stat.t |
7374
|
|
|
|
|
|
|
index 68a6fb6bbd..a59a342e20 100644 |
7375
|
|
|
|
|
|
|
--- dist/Time-HiRes/t/stat.t |
7376
|
|
|
|
|
|
|
+++ dist/Time-HiRes/t/stat.t |
7377
|
|
|
|
|
|
|
@@ -13,14 +13,14 @@ BEGIN { |
7378
|
|
|
|
|
|
|
} |
7379
|
|
|
|
|
|
|
} |
7380
|
|
|
|
|
|
|
|
7381
|
|
|
|
|
|
|
-use Test::More 0.82 tests => 43; |
7382
|
|
|
|
|
|
|
+use Test::More tests => 43; |
7383
|
|
|
|
|
|
|
use t::Watchdog; |
7384
|
|
|
|
|
|
|
|
7385
|
|
|
|
|
|
|
my @atime; |
7386
|
|
|
|
|
|
|
my @mtime; |
7387
|
|
|
|
|
|
|
for (1..5) { |
7388
|
|
|
|
|
|
|
Time::HiRes::sleep(rand(0.1) + 0.1); |
7389
|
|
|
|
|
|
|
- open(X, ">$$"); |
7390
|
|
|
|
|
|
|
+ open(X, '>', $$); |
7391
|
|
|
|
|
|
|
print X $$; |
7392
|
|
|
|
|
|
|
close(X); |
7393
|
|
|
|
|
|
|
my($a, $stat, $b) = ("a", [Time::HiRes::stat($$)], "b"); |
7394
|
|
|
|
|
|
|
@@ -33,7 +33,7 @@ for (1..5) { |
7395
|
|
|
|
|
|
|
is $b, "b"; |
7396
|
|
|
|
|
|
|
is_deeply $lstat, $stat; |
7397
|
|
|
|
|
|
|
Time::HiRes::sleep(rand(0.1) + 0.1); |
7398
|
|
|
|
|
|
|
- open(X, "<$$"); |
7399
|
|
|
|
|
|
|
+ open(X, '<', $$); |
7400
|
|
|
|
|
|
|
; |
7401
|
|
|
|
|
|
|
close(X); |
7402
|
|
|
|
|
|
|
$stat = [Time::HiRes::stat($$)]; |
7403
|
|
|
|
|
|
|
@@ -42,8 +42,8 @@ for (1..5) { |
7404
|
|
|
|
|
|
|
is_deeply $lstat, $stat; |
7405
|
|
|
|
|
|
|
} |
7406
|
|
|
|
|
|
|
1 while unlink $$; |
7407
|
|
|
|
|
|
|
-note "mtime = @mtime"; |
7408
|
|
|
|
|
|
|
-note "atime = @atime"; |
7409
|
|
|
|
|
|
|
+print("# mtime = @mtime\n"); |
7410
|
|
|
|
|
|
|
+print("# atime = @atime\n"); |
7411
|
|
|
|
|
|
|
my $ai = 0; |
7412
|
|
|
|
|
|
|
my $mi = 0; |
7413
|
|
|
|
|
|
|
my $ss = 0; |
7414
|
|
|
|
|
|
|
@@ -63,7 +63,7 @@ for (my $i = 1; $i < @mtime; $i++) { |
7415
|
|
|
|
|
|
|
$ss++; |
7416
|
|
|
|
|
|
|
} |
7417
|
|
|
|
|
|
|
} |
7418
|
|
|
|
|
|
|
-note "ai = $ai, mi = $mi, ss = $ss"; |
7419
|
|
|
|
|
|
|
+print("# ai = $ai, mi = $mi, ss = $ss\n"); |
7420
|
|
|
|
|
|
|
# Need at least 75% of monotonical increase and |
7421
|
|
|
|
|
|
|
# 20% of subsecond results. Yes, this is guessing. |
7422
|
|
|
|
|
|
|
SKIP: { |
7423
|
|
|
|
|
|
|
@@ -75,7 +75,7 @@ SKIP: { |
7424
|
|
|
|
|
|
|
my $targetname = "tgt$$"; |
7425
|
|
|
|
|
|
|
my $linkname = "link$$"; |
7426
|
|
|
|
|
|
|
SKIP: { |
7427
|
|
|
|
|
|
|
- open(X, ">$targetname"); |
7428
|
|
|
|
|
|
|
+ open(X, '>', $targetname); |
7429
|
|
|
|
|
|
|
print X $$; |
7430
|
|
|
|
|
|
|
close(X); |
7431
|
|
|
|
|
|
|
eval { symlink $targetname, $linkname or die "can't symlink: $!"; }; |
7432
|
|
|
|
|
|
|
diff --git a/dist/Time-HiRes/t/time.t b/dist/Time-HiRes/t/time.t |
7433
|
|
|
|
|
|
|
index feec4799d9..6f219f9e0c 100644 |
7434
|
|
|
|
|
|
|
--- dist/Time-HiRes/t/time.t |
7435
|
|
|
|
|
|
|
+++ dist/Time-HiRes/t/time.t |
7436
|
|
|
|
|
|
|
@@ -1,6 +1,6 @@ |
7437
|
|
|
|
|
|
|
use strict; |
7438
|
|
|
|
|
|
|
|
7439
|
|
|
|
|
|
|
-use Test::More 0.82 tests => 2; |
7440
|
|
|
|
|
|
|
+use Test::More tests => 2; |
7441
|
|
|
|
|
|
|
use t::Watchdog; |
7442
|
|
|
|
|
|
|
|
7443
|
|
|
|
|
|
|
BEGIN { require_ok "Time::HiRes"; } |
7444
|
|
|
|
|
|
|
@@ -16,8 +16,8 @@ SKIP: { |
7445
|
|
|
|
|
|
|
# (CORE::time() may be rounding down, up, or closest), |
7446
|
|
|
|
|
|
|
# but allow 10% of slop. |
7447
|
|
|
|
|
|
|
ok abs($s) / $n <= 1.10 |
7448
|
|
|
|
|
|
|
- or note "Time::HiRes::time() not close to CORE::time()"; |
7449
|
|
|
|
|
|
|
- note "s = $s, n = $n, s/n = ", abs($s)/$n; |
7450
|
|
|
|
|
|
|
+ or print("# Time::HiRes::time() not close to CORE::time()\n"); |
7451
|
|
|
|
|
|
|
+ printf("# s = $s, n = $n, s/n = %s\n", abs($s)/$n); |
7452
|
|
|
|
|
|
|
} |
7453
|
|
|
|
|
|
|
|
7454
|
|
|
|
|
|
|
1; |
7455
|
|
|
|
|
|
|
diff --git a/dist/Time-HiRes/t/tv_interval.t b/dist/Time-HiRes/t/tv_interval.t |
7456
|
|
|
|
|
|
|
index bffcf39ec1..8ac876daf3 100644 |
7457
|
|
|
|
|
|
|
--- dist/Time-HiRes/t/tv_interval.t |
7458
|
|
|
|
|
|
|
+++ dist/Time-HiRes/t/tv_interval.t |
7459
|
|
|
|
|
|
|
@@ -1,10 +1,10 @@ |
7460
|
|
|
|
|
|
|
use strict; |
7461
|
|
|
|
|
|
|
|
7462
|
|
|
|
|
|
|
-use Test::More 0.82 tests => 2; |
7463
|
|
|
|
|
|
|
+use Test::More tests => 2; |
7464
|
|
|
|
|
|
|
|
7465
|
|
|
|
|
|
|
BEGIN { require_ok "Time::HiRes"; } |
7466
|
|
|
|
|
|
|
|
7467
|
|
|
|
|
|
|
my $f = Time::HiRes::tv_interval [5, 100_000], [10, 500_000]; |
7468
|
|
|
|
|
|
|
-ok abs($f - 5.4) < 0.001 or note $f; |
7469
|
|
|
|
|
|
|
+ok abs($f - 5.4) < 0.001 or print("# $f\n"); |
7470
|
|
|
|
|
|
|
|
7471
|
|
|
|
|
|
|
1; |
7472
|
|
|
|
|
|
|
diff --git a/dist/Time-HiRes/t/ualarm.t b/dist/Time-HiRes/t/ualarm.t |
7473
|
|
|
|
|
|
|
index 12ef4b52cc..b50a175f44 100644 |
7474
|
|
|
|
|
|
|
--- dist/Time-HiRes/t/ualarm.t |
7475
|
|
|
|
|
|
|
+++ dist/Time-HiRes/t/ualarm.t |
7476
|
|
|
|
|
|
|
@@ -8,7 +8,7 @@ BEGIN { |
7477
|
|
|
|
|
|
|
} |
7478
|
|
|
|
|
|
|
} |
7479
|
|
|
|
|
|
|
|
7480
|
|
|
|
|
|
|
-use Test::More 0.82 tests => 12; |
7481
|
|
|
|
|
|
|
+use Test::More tests => 12; |
7482
|
|
|
|
|
|
|
use t::Watchdog; |
7483
|
|
|
|
|
|
|
|
7484
|
|
|
|
|
|
|
use Config; |
7485
|
|
|
|
|
|
|
@@ -24,13 +24,13 @@ SKIP: { |
7486
|
|
|
|
|
|
|
$tick = 0; Time::HiRes::ualarm(10_000); while ($tick == 0) { } |
7487
|
|
|
|
|
|
|
my $three = CORE::time; |
7488
|
|
|
|
|
|
|
ok $one == $two || $two == $three |
7489
|
|
|
|
|
|
|
- or note "slept too long, $one $two $three"; |
7490
|
|
|
|
|
|
|
- note "tick = $tick, one = $one, two = $two, three = $three"; |
7491
|
|
|
|
|
|
|
+ or print("# slept too long, $one $two $three\n"); |
7492
|
|
|
|
|
|
|
+ print("# tick = $tick, one = $one, two = $two, three = $three\n"); |
7493
|
|
|
|
|
|
|
|
7494
|
|
|
|
|
|
|
$tick = 0; Time::HiRes::ualarm(10_000, 10_000); while ($tick < 3) { } |
7495
|
|
|
|
|
|
|
ok 1; |
7496
|
|
|
|
|
|
|
Time::HiRes::ualarm(0); |
7497
|
|
|
|
|
|
|
- note "tick = $tick, one = $one, two = $two, three = $three"; |
7498
|
|
|
|
|
|
|
+ print("# tick = $tick, one = $one, two = $two, three = $three\n"); |
7499
|
|
|
|
|
|
|
} |
7500
|
|
|
|
|
|
|
|
7501
|
|
|
|
|
|
|
eval { Time::HiRes::ualarm(-4) }; |
7502
|
|
|
|
|
|
|
@@ -59,24 +59,24 @@ for my $n (100_000, 1_100_000, 2_200_000, 4_300_000) { |
7503
|
|
|
|
|
|
|
my $alarmed = 0; |
7504
|
|
|
|
|
|
|
local $SIG{ ALRM } = sub { $alarmed++ }; |
7505
|
|
|
|
|
|
|
my $t0 = Time::HiRes::time(); |
7506
|
|
|
|
|
|
|
- note "t0 = $t0"; |
7507
|
|
|
|
|
|
|
- note "ualarm($n)"; |
7508
|
|
|
|
|
|
|
+ print("# t0 = $t0\n"); |
7509
|
|
|
|
|
|
|
+ print("# ualarm($n)\n"); |
7510
|
|
|
|
|
|
|
Time::HiRes::ualarm($n); 1 while $alarmed == 0; |
7511
|
|
|
|
|
|
|
my $t1 = Time::HiRes::time(); |
7512
|
|
|
|
|
|
|
- note "t1 = $t1"; |
7513
|
|
|
|
|
|
|
+ print("# t1 = $t1\n"); |
7514
|
|
|
|
|
|
|
my $dt = $t1 - $t0; |
7515
|
|
|
|
|
|
|
- note "dt = $dt"; |
7516
|
|
|
|
|
|
|
+ print("# dt = $dt\n"); |
7517
|
|
|
|
|
|
|
my $r = $dt / ($n/1e6); |
7518
|
|
|
|
|
|
|
- note "r = $r"; |
7519
|
|
|
|
|
|
|
+ print("# r = $r\n"); |
7520
|
|
|
|
|
|
|
$ok = |
7521
|
|
|
|
|
|
|
($n < 1_000_000 || # Too much noise. |
7522
|
|
|
|
|
|
|
($r >= 0.8 && $r <= 1.6)); |
7523
|
|
|
|
|
|
|
last if $ok; |
7524
|
|
|
|
|
|
|
my $nap = bellish(3, 15); |
7525
|
|
|
|
|
|
|
- note sprintf "Retrying in %.1f seconds...\n", $nap; |
7526
|
|
|
|
|
|
|
+ printf("# Retrying in %.1f seconds...\n", $nap); |
7527
|
|
|
|
|
|
|
Time::HiRes::sleep($nap); |
7528
|
|
|
|
|
|
|
} |
7529
|
|
|
|
|
|
|
- ok $ok or note "ualarm($n) close enough"; |
7530
|
|
|
|
|
|
|
+ ok $ok or print("# ualarm($n) close enough\n"); |
7531
|
|
|
|
|
|
|
} |
7532
|
|
|
|
|
|
|
|
7533
|
|
|
|
|
|
|
{ |
7534
|
|
|
|
|
|
|
@@ -93,12 +93,12 @@ for my $n (100_000, 1_100_000, 2_200_000, 4_300_000) { |
7535
|
|
|
|
|
|
|
} while $t1 - $t0 <= 0.3; |
7536
|
|
|
|
|
|
|
my $got1 = Time::HiRes::ualarm(0); |
7537
|
|
|
|
|
|
|
|
7538
|
|
|
|
|
|
|
- note "t0 = $t0"; |
7539
|
|
|
|
|
|
|
- note "got0 = $got0"; |
7540
|
|
|
|
|
|
|
- note "t1 = $t1"; |
7541
|
|
|
|
|
|
|
- note "t1 - t0 = ", ($t1 - $t0); |
7542
|
|
|
|
|
|
|
- note "got1 = $got1"; |
7543
|
|
|
|
|
|
|
- ok $got0 == 0 or note $got0; |
7544
|
|
|
|
|
|
|
+ print("# t0 = $t0\n"); |
7545
|
|
|
|
|
|
|
+ print("# got0 = $got0\n"); |
7546
|
|
|
|
|
|
|
+ print("# t1 = $t1\n"); |
7547
|
|
|
|
|
|
|
+ printf("# t1 - t0 = %s\n", ($t1 - $t0)); |
7548
|
|
|
|
|
|
|
+ print("# got1 = $got1\n"); |
7549
|
|
|
|
|
|
|
+ ok $got0 == 0 or print("# $got0\n"); |
7550
|
|
|
|
|
|
|
SKIP: { |
7551
|
|
|
|
|
|
|
skip "alarm interval exceeded", 2 if $t1 - $t0 >= 0.5; |
7552
|
|
|
|
|
|
|
ok $got1 > 0; |
7553
|
|
|
|
|
|
|
@@ -106,7 +106,7 @@ for my $n (100_000, 1_100_000, 2_200_000, 4_300_000) { |
7554
|
|
|
|
|
|
|
} |
7555
|
|
|
|
|
|
|
ok $got1 < 300_000; |
7556
|
|
|
|
|
|
|
my $got2 = Time::HiRes::ualarm(0); |
7557
|
|
|
|
|
|
|
- ok $got2 == 0 or note $got2; |
7558
|
|
|
|
|
|
|
+ ok $got2 == 0 or print("# $got2\n"); |
7559
|
|
|
|
|
|
|
} |
7560
|
|
|
|
|
|
|
|
7561
|
|
|
|
|
|
|
1; |
7562
|
|
|
|
|
|
|
diff --git a/dist/Time-HiRes/t/usleep.t b/dist/Time-HiRes/t/usleep.t |
7563
|
|
|
|
|
|
|
index 0d6bacfac3..bdf372bd16 100644 |
7564
|
|
|
|
|
|
|
--- dist/Time-HiRes/t/usleep.t |
7565
|
|
|
|
|
|
|
+++ dist/Time-HiRes/t/usleep.t |
7566
|
|
|
|
|
|
|
@@ -8,7 +8,7 @@ BEGIN { |
7567
|
|
|
|
|
|
|
} |
7568
|
|
|
|
|
|
|
} |
7569
|
|
|
|
|
|
|
|
7570
|
|
|
|
|
|
|
-use Test::More 0.82 tests => 6; |
7571
|
|
|
|
|
|
|
+use Test::More tests => 6; |
7572
|
|
|
|
|
|
|
use t::Watchdog; |
7573
|
|
|
|
|
|
|
|
7574
|
|
|
|
|
|
|
eval { Time::HiRes::usleep(-2) }; |
7575
|
|
|
|
|
|
|
@@ -23,7 +23,7 @@ my $two = CORE::time; |
7576
|
|
|
|
|
|
|
Time::HiRes::usleep(10_000); |
7577
|
|
|
|
|
|
|
my $three = CORE::time; |
7578
|
|
|
|
|
|
|
ok $one == $two || $two == $three |
7579
|
|
|
|
|
|
|
-or note "slept too long, $one $two $three"; |
7580
|
|
|
|
|
|
|
+or print("# slept too long, $one $two $three\n"); |
7581
|
|
|
|
|
|
|
|
7582
|
|
|
|
|
|
|
SKIP: { |
7583
|
|
|
|
|
|
|
skip "no gettimeofday", 1 unless &Time::HiRes::d_gettimeofday; |
7584
|
|
|
|
|
|
|
@@ -31,7 +31,7 @@ SKIP: { |
7585
|
|
|
|
|
|
|
Time::HiRes::usleep(500_000); |
7586
|
|
|
|
|
|
|
my $f2 = Time::HiRes::time(); |
7587
|
|
|
|
|
|
|
my $d = $f2 - $f; |
7588
|
|
|
|
|
|
|
- ok $d > 0.4 && $d < 0.9 or note "slept $d secs $f to $f2"; |
7589
|
|
|
|
|
|
|
+ ok $d > 0.4 && $d < 0.9 or print("# slept $d secs $f to $f2\n"); |
7590
|
|
|
|
|
|
|
} |
7591
|
|
|
|
|
|
|
|
7592
|
|
|
|
|
|
|
SKIP: { |
7593
|
|
|
|
|
|
|
@@ -39,7 +39,7 @@ SKIP: { |
7594
|
|
|
|
|
|
|
my $r = [ Time::HiRes::gettimeofday() ]; |
7595
|
|
|
|
|
|
|
Time::HiRes::sleep( 0.5 ); |
7596
|
|
|
|
|
|
|
my $f = Time::HiRes::tv_interval $r; |
7597
|
|
|
|
|
|
|
- ok $f > 0.4 && $f < 0.9 or note "slept $f instead of 0.5 secs."; |
7598
|
|
|
|
|
|
|
+ ok $f > 0.4 && $f < 0.9 or print("# slept $f instead of 0.5 secs.\n"); |
7599
|
|
|
|
|
|
|
} |
7600
|
|
|
|
|
|
|
|
7601
|
|
|
|
|
|
|
SKIP: { |
7602
|
|
|
|
|
|
|
@@ -59,7 +59,7 @@ SKIP: { |
7603
|
|
|
|
|
|
|
|
7604
|
|
|
|
|
|
|
SKIP: { |
7605
|
|
|
|
|
|
|
skip $msg, 1 unless $td < $sleep * (1 + $limit); |
7606
|
|
|
|
|
|
|
- ok $a < $limit or note $msg; |
7607
|
|
|
|
|
|
|
+ ok $a < $limit or print("# $msg\n"); |
7608
|
|
|
|
|
|
|
} |
7609
|
|
|
|
|
|
|
|
7610
|
|
|
|
|
|
|
$t0 = Time::HiRes::gettimeofday(); |
7611
|
|
|
|
|
|
|
@@ -71,7 +71,7 @@ SKIP: { |
7612
|
|
|
|
|
|
|
|
7613
|
|
|
|
|
|
|
SKIP: { |
7614
|
|
|
|
|
|
|
skip $msg, 1 unless $td < $sleep * (1 + $limit); |
7615
|
|
|
|
|
|
|
- ok $a < $limit or note $msg; |
7616
|
|
|
|
|
|
|
+ ok $a < $limit or print("# $msg\n"); |
7617
|
|
|
|
|
|
|
} |
7618
|
|
|
|
|
|
|
} |
7619
|
|
|
|
|
|
|
|
7620
|
|
|
|
|
|
|
diff --git a/dist/Time-HiRes/typemap b/dist/Time-HiRes/typemap |
7621
|
|
|
|
|
|
|
index 1124eb6483..3fa91f3a0b 100644 |
7622
|
|
|
|
|
|
|
--- dist/Time-HiRes/typemap |
7623
|
|
|
|
|
|
|
+++ dist/Time-HiRes/typemap |
7624
|
|
|
|
|
|
|
@@ -28,6 +28,8 @@ AV * T_AVREF |
7625
|
|
|
|
|
|
|
HV * T_HVREF |
7626
|
|
|
|
|
|
|
CV * T_CVREF |
7627
|
|
|
|
|
|
|
|
7628
|
|
|
|
|
|
|
+clockid_t T_IV |
7629
|
|
|
|
|
|
|
+ |
7630
|
|
|
|
|
|
|
IV T_IV |
7631
|
|
|
|
|
|
|
UV T_UV |
7632
|
|
|
|
|
|
|
NV T_NV |
7633
|
|
|
|
|
|
|
END |
7634
|
|
|
|
|
|
|
} |
7635
|
|
|
|
|
|
|
|
7636
|
|
|
|
|
|
|
sub _norm_ver { |
7637
|
0
|
|
|
0
|
|
|
my $ver = shift; |
7638
|
0
|
|
|
|
|
|
my @v = split(qr/[._]0*/, $ver); |
7639
|
0
|
|
0
|
|
|
|
$v[2] ||= 0; |
7640
|
0
|
|
|
|
|
|
return sprintf '%d.%03d%03d', @v; |
7641
|
|
|
|
|
|
|
} |
7642
|
|
|
|
|
|
|
|
7643
|
|
|
|
|
|
|
sub _patch_develpatchperlversion { |
7644
|
0
|
0
|
|
0
|
|
|
return if -d '.git'; |
7645
|
0
|
|
0
|
|
|
|
my $dpv = $Devel::PatchPerl::VERSION || "(unreleased)"; |
7646
|
0
|
|
|
|
|
|
_patch(<<"END"); |
7647
|
|
|
|
|
|
|
diff --git a/Configure b/Configure |
7648
|
|
|
|
|
|
|
index e12c8bb..1a8088f 100755 |
7649
|
|
|
|
|
|
|
--- Configure |
7650
|
|
|
|
|
|
|
+++ Configure |
7651
|
|
|
|
|
|
|
@@ -25151,6 +25151,8 @@ zcat='\$zcat' |
7652
|
|
|
|
|
|
|
zip='\$zip' |
7653
|
|
|
|
|
|
|
EOT |
7654
|
|
|
|
|
|
|
|
7655
|
|
|
|
|
|
|
+echo "BuiltWithPatchPerl='$dpv'" >>config.sh |
7656
|
|
|
|
|
|
|
+ |
7657
|
|
|
|
|
|
|
: add special variables |
7658
|
|
|
|
|
|
|
\$test -f \$src/patchlevel.h && \ |
7659
|
|
|
|
|
|
|
awk '/^#define[ ]+PERL_/ {printf "\%s=\%s\\n",\$2,\$3}' \$src/patchlevel.h >>config.sh |
7660
|
|
|
|
|
|
|
END |
7661
|
|
|
|
|
|
|
} |
7662
|
|
|
|
|
|
|
|
7663
|
|
|
|
|
|
|
qq[patchin']; |
7664
|
|
|
|
|
|
|
|
7665
|
|
|
|
|
|
|
__END__ |