ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/App-Staticperl/mkbundle
(Generate patch)

Comparing App-Staticperl/mkbundle (file contents):
Revision 1.29 by root, Sun Jul 10 01:37:56 2011 UTC vs.
Revision 1.34 by root, Mon Mar 12 21:45:10 2012 UTC

76 my $dir = find_incdir $_[1] 76 my $dir = find_incdir $_[1]
77 or return; 77 or return;
78 78
79 syswrite $W_TRACER, "-\n$dir\n$_[1]\n"; 79 syswrite $W_TRACER, "-\n$dir\n$_[1]\n";
80 80
81 open my $fh, "<:perlio", "$dir/$_[1]" 81 open my $fh, "<:raw:perlio", "$dir/$_[1]"
82 or warn "ERROR: $dir/$_[1]: $!\n"; 82 or warn "ERROR: $dir/$_[1]: $!\n";
83 83
84 $fh 84 $fh
85 }; 85 };
86 86
162 my ($variant, $src, $filter) = @_; 162 my ($variant, $src, $filter) = @_;
163 163
164 if (length $CACHE and 2048 <= length $src and defined $variant) { 164 if (length $CACHE and 2048 <= length $src and defined $variant) {
165 my $file = "$CACHE/" . Digest::MD5::md5_hex "$CACHEVER\x00$variant\x00$src"; 165 my $file = "$CACHE/" . Digest::MD5::md5_hex "$CACHEVER\x00$variant\x00$src";
166 166
167 if (open my $fh, "<:perlio", $file) { 167 if (open my $fh, "<:raw:perlio", $file) {
168 print "using cache for $file\n" 168 print "using cache for $file\n"
169 if $VERBOSE >= 7; 169 if $VERBOSE >= 7;
170 170
171 local $/; 171 local $/;
172 return <$fh>; 172 return <$fh>;
175 $src = $filter->($src); 175 $src = $filter->($src);
176 176
177 print "creating cache entry $file\n" 177 print "creating cache entry $file\n"
178 if $VERBOSE >= 8; 178 if $VERBOSE >= 8;
179 179
180 if (open my $fh, ">:perlio", "$file~") { 180 if (open my $fh, ">:raw:perlio", "$file~") {
181 if ((syswrite $fh, $src) == length $src) { 181 if ((syswrite $fh, $src) == length $src) {
182 close $fh; 182 close $fh;
183 rename "$file~", $file; 183 rename "$file~", $file;
184 } 184 }
185 } 185 }
563 or die "ERROR: $pm: path too long (only 128 octets supported)\n"; 563 or die "ERROR: $pm: path too long (only 128 octets supported)\n";
564 564
565 my $src = ref $path 565 my $src = ref $path
566 ? $$path 566 ? $$path
567 : do { 567 : do {
568 open my $pm, "<", $path 568 open my $pm, "<:raw:perlio", $path
569 or die "$path: $!"; 569 or die "$path: $!";
570 570
571 local $/; 571 local $/;
572 572
573 <$pm> 573 <$pm>
1027 PL_preambleav = newAV (); 1027 PL_preambleav = newAV ();
1028 1028
1029 av_unshift (PL_preambleav, 1); 1029 av_unshift (PL_preambleav, 1);
1030 av_store (PL_preambleav, 0, newSVpv (bootstrap, sizeof (bootstrap) - 1)); 1030 av_store (PL_preambleav, 0, newSVpv (bootstrap, sizeof (bootstrap) - 1));
1031 #else 1031 #else
1032 av_create_and_unshift_one (&PL_preambleav, newSVpv (bootstrap, sizeof (bootstrap) - 1)); 1032 Perl_av_create_and_unshift_one (&PL_preambleav, newSVpv (bootstrap, sizeof (bootstrap) - 1));
1033 #endif 1033 #endif
1034 1034
1035 if (PL_oldname) 1035 if (PL_oldname)
1036 ((XSINIT_t)PL_oldname)(aTHX); 1036 ((XSINIT_t)PL_oldname)(aTHX);
1037} 1037}
1171 1171
1172{ 1172{
1173 print "generating $PREFIX.ccopts... " 1173 print "generating $PREFIX.ccopts... "
1174 if $VERBOSE >= 1; 1174 if $VERBOSE >= 1;
1175 1175
1176 $ccopts = "$Config{ccflags} $Config{optimize} $Config{cppflags} -I\"$Config{archlibexp}/CORE\""; 1176 $ccopts = "$Config{ccflags} $Config{optimize} $Config{cppflags} -I$Config{archlibexp}/CORE";
1177 $ccopts =~ s/([\(\)])/\\$1/g; 1177 $ccopts =~ s/([\(\)])/\\$1/g;
1178 1178
1179 open my $fh, ">$PREFIX.ccopts" 1179 open my $fh, ">$PREFIX.ccopts"
1180 or die "$PREFIX.ccopts: $!"; 1180 or die "$PREFIX.ccopts: $!";
1181 print $fh $ccopts; 1181 print $fh $ccopts;
1192 $ldopts = $STATIC ? "-static " : ""; 1192 $ldopts = $STATIC ? "-static " : "";
1193 1193
1194 $ldopts .= "$Config{ccdlflags} $Config{ldflags} @libs $Config{archlibexp}/CORE/$Config{libperl} $Config{perllibs}"; 1194 $ldopts .= "$Config{ccdlflags} $Config{ldflags} @libs $Config{archlibexp}/CORE/$Config{libperl} $Config{perllibs}";
1195 1195
1196 my %seen; 1196 my %seen;
1197 $ldopts .= " $_" for grep !$seen{$_}++, ($extralibs =~ /(\S+)/g); 1197 $ldopts .= " $_" for reverse grep !$seen{$_}++, reverse +($extralibs =~ /(\S+)/g);
1198 1198
1199 for (@staticlibs) { 1199 for (@staticlibs) {
1200 $ldopts =~ s/(^|\s) (-l\Q$_\E) ($|\s)/$1-Wl,-Bstatic $2 -Wl,-Bdynamic$3/gx; 1200 $ldopts =~ s/(^|\s) (-l\Q$_\E) ($|\s)/$1-Wl,-Bstatic $2 -Wl,-Bdynamic$3/gx;
1201 } 1201 }
1202 1202
1221 print "$build\n" 1221 print "$build\n"
1222 if $VERBOSE >= 2; 1222 if $VERBOSE >= 2;
1223 1223
1224 system $build; 1224 system $build;
1225 1225
1226# unlink "$PREFIX.$_" 1226 unlink "$PREFIX.$_"
1227# for qw(ccopts ldopts c h); 1227 for qw(ccopts ldopts c h);
1228 1228
1229 print "\n" 1229 print "\n"
1230 if $VERBOSE >= 1; 1230 if $VERBOSE >= 1;
1231} 1231}
1232 1232

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines