11 my $CoreBuild = -d "ext" && -f "perl.h" && -d "symbian" && -f "perl.c";
15 if (exists $ENV{EPOCROOT}) {
16 if ($ENV{EPOCROOT} =~ m!\\Symbian\\UIQ_21\\$!i) {
17 $SymbianVersion = '7.0s'; # TODO: other UIQ versions
18 } elsif ($ENV{EPOCROOT} =~ m!\\Symbian\\(.+?)\\!i) {
23 $SymbianVersion = $ENV{XSBUILD_SYMBIAN_VERSION}
24 if exists $ENV{XSBUILD_SYMBIAN_VERSION};
26 my $PerlVersion = $ENV{XSBUILD_PERL_VERSION};
37 $0: Usage: $0 [--symbian=version] [--perl=version]
39 [--csuffix=csuffix] [--cplusplus|--cpp]
40 [--win=win] [--arm=arm]
41 [--config|--build|--clean|--distclean|--sis] ext
52 my $BUILDROOT = getcwd();
54 if ( !defined $PerlVersion && $0 =~ m:\\symbian\\perl\\(.+)\\bin\\xsbuild.pl:i )
59 if ( !defined $SymbianVersion) {
60 ($SymbianVersion) = ($ENV{PATH} =~ m!\\Symbian\\(.+?)\\!i);
63 my ($SYMBIAN_ROOT, $SYMBIAN_VERSION, $SDK_NAME, $SDK_VARIANT, $SDK_VERSION);
66 unshift @INC, "symbian";
68 my %VERSION = %{ do "version.pl" };
69 ($SYMBIAN_ROOT, $SYMBIAN_VERSION, $SDK_NAME, $SDK_VARIANT, $SDK_VERSION) =
71 $VERSION = "$VERSION{REVISION}$VERSION{VERSION}$VERSION{SUBVERSION}";
72 $R_V_SV = "$VERSION{REVISION}.$VERSION{VERSION}.$VERSION{SUBVERSION}";
73 $BUILDROOT = do "cwd.pl";
74 $PerlVersion = $R_V_SV;
81 'symbian=s' => \$SymbianVersion,
82 'perl=s' => \$PerlVersion,
83 'extversion=s' => \$CONF{EXTVERSION},
84 'csuffix=s' => \$CSuffix,
85 'cplusplus|cpp' => \$CPlusPlus,
91 'distclean' => \$DistClean,
97 $CSuffix = '.cpp' if $CPlusPlus;
98 $Build = !( $Config || $Clean || $DistClean ) || $Sis unless defined $Build;
100 die "$0: Symbian version undefined\n" unless defined $SymbianVersion;
102 $SymbianVersion =~ s:/:\\:g;
104 die "$0: Symbian version '$SymbianVersion' not found\n"
105 unless -d "\\Symbian\\$SymbianVersion";
107 die "$0: Perl version undefined\n" unless defined $PerlVersion;
109 die "$0: Perl version '$PerlVersion' not found\n"
110 if !$CoreBuild && !-d "\\Symbian\\Perl\\$PerlVersion";
112 print "Configuring with Symbian $SymbianVersion and Perl $PerlVersion...\n";
114 $PERLSDK = "\\Symbian\\Perl\\$PerlVersion";
116 $R_V_SV = $PerlVersion;
118 $VERSION = $PerlVersion unless defined $VERSION;
120 $VERSION =~ tr/.//d if defined $VERSION;
122 $ENV{SDK} = $SYMBIAN_ROOT; # For the Errno extension
123 $ENV{CROSS} = 1; # For the Encode extension (unbuilt now)
126 my $UREL = "$SYMBIAN_ROOT\\epoc32\\release\\-ARM-\\$UARM";
128 if (exists $ENV{UREL}) {
129 $UREL = $ENV{UREL}; # from sdk.pl
130 $UREL =~ s/-ARM-/$ARM/;
131 $UARM = $ENV{UARM}; # from sdk.pl
132 $SRCDBG = $UARM eq 'udeb' ? "SRCDBG" : "";
140 open( BLD_INF, ">bld.inf" ) or die "$0: bld.inf: $!\n";
141 print BLD_INF <<__EOF__;
152 print "xsbuild: ", $cmd, "\n";
157 my ( $PL, $dir, $file ) = @_;
158 if ( defined $file ) {
159 print "\t(Running $dir\\$PL to create $file)\n";
163 print "\t(Running $dir\\$PL)\n";
167 # Problem: the Config.pm we have in $BUILDROOT\\lib carries the
168 # version number of the Perl we are building, while the Perl
169 # we are running might have some other version. Solution:
170 # temporarily replace the Config.pm with a patched version.
171 my $V = sprintf "%vd", $^V;
172 unlink("$BUILDROOT\\lib\\Config.pm.bak");
173 print "(patching $BUILDROOT\\lib\\Config.pm)\n";
174 system_echo("perl -pi.bak -e \"s:\\Q$R_V_SV:$V:\" $BUILDROOT\\lib\\Config.pm");
176 system_echo("perl -I$BUILDROOT\\lib -I$BUILDROOT\\xlib\\symbian -I$BUILDROOT\\t\\lib $PL") == 0
177 or warn "$0: $PL failed.\n";
179 system_echo("copy $BUILDROOT\\lib\\Config.pm.bak $BUILDROOT\\lib\\Config.pm");
181 if ( defined $file ) { -s $file or die "$0: No $file created.\n" }
185 my ( $conf, $k ) = @_;
186 push @{ $conf->{$k} }, split( ' ', $1 ) if /^$k\s(.+)$/;
189 sub uniquefy_filenames {
192 for my $i (@{$_[0]}) {
194 $i = lc $i if $i =~ m!\\!;
196 push @$b, $i unless $c{$i}++;
202 my ( $conf, $mmp ) = @_;
203 if ( -r $mmp && open( MMP, "<$mmp" ) ) {
204 print "\tReading $mmp...\n";
207 $conf->{TARGET} = $1 if /^TARGET\s+(.+)$/;
208 $conf->{TARGETPATH} = $1 if /^TARGETPATH\s+(.+)$/;
209 $conf->{EXTVERSION} = $1 if /^EXTVERSION\s+(.+)$/;
210 read_old_multi( $conf, "SOURCE" );
211 read_old_multi( $conf, "SOURCEPATH" );
212 read_old_multi( $conf, "USERINCLUDE" );
213 read_old_multi( $conf, "SYSTEMINCLUDE" );
214 read_old_multi( $conf, "LIBRARY" );
215 read_old_multi( $conf, "MACRO" );
222 my ( $ext, $base, $userinclude, @src ) = @_;
224 my $extdash = $ext; $extdash =~ s!\\!-!g;
226 print "\t$base.mmp\n";
227 $CONF{TARGET} = "perl$VERSION-$extdash.dll";
228 $CONF{TARGETPATH} = "\\System\\Libs\\Perl\\$R_V_SV";
229 $CONF{SOURCE} = [@src];
230 $CONF{SOURCEPATH} = [ $CWD, $BUILDROOT ];
231 $CONF{USERINCLUDE} = [ $CWD, $BUILDROOT ];
232 $CONF{SYSTEMINCLUDE} = ["$PERLSDK\\include"] unless $CoreBuild;
233 $CONF{SYSTEMINCLUDE} = [ $BUILDROOT, "$BUILDROOT\\symbian" ] if $CoreBuild;
236 read_mmp( \%CONF, "_init.mmp" );
237 read_mmp( \%CONF, "$base.mmp" );
239 if ($base eq 'Zlib') {
240 push @{$CONF{USERINCLUDE}}, "$CWD\\zlib-src";
243 for my $ui ( @{$userinclude} ) {
245 if ( $ui =~ m!^(?:[CD]:)?\\! ) {
246 push @{ $CONF{USERINCLUDE} }, $ui;
249 push @{ $CONF{USERINCLUDE} }, "$BUILDROOT\\$ui";
252 push @{ $CONF{SYSTEMINCLUDE} }, "\\epoc32\\include";
253 push @{ $CONF{SYSTEMINCLUDE} }, "\\epoc32\\include\\libc";
254 push @{ $CONF{LIBRARY} }, "euser.lib";
255 push @{ $CONF{LIBRARY} }, "estlib.lib";
256 push @{ $CONF{LIBRARY} }, "perl$VERSION.lib";
257 push @{ $CONF{MACRO} }, "SYMBIAN" unless $CoreBuild;
258 push @{ $CONF{MACRO} }, "PERL_EXT" if $CoreBuild;
259 push @{ $CONF{MACRO} }, "MULTIPLICITY";
260 push @{ $CONF{MACRO} }, "PERL_IMPLICIT_CONTEXT";
261 push @{ $CONF{MACRO} }, "PERL_GLOBAL_STRUCT";
262 push @{ $CONF{MACRO} }, "PERL_GLOBAL_STRUCT_PRIVATE";
264 if ($SDK_VARIANT eq 'S60') {
265 push @{ $CONF{MACRO} }, '__SERIES60__'
266 unless grep { $_ eq '__SERIES60__' } @{ $CONF{MACRO} };
268 if ($SDK_VARIANT eq 'S80') {
269 push @{ $CONF{MACRO} }, '__SERIES80__'
270 unless grep { $_ eq '__SERIES80__' } @{ $CONF{MACRO} };
272 if ($SDK_VARIANT eq 'UIQ') {
273 push @{ $CONF{MACRO} }, '__UIQ__'
274 unless grep { $_ eq '__UIQ__' } @{ $CONF{MACRO} };
277 for my $u (qw(SOURCE SOURCEPATH SYSTEMINCLUDE USERINCLUDE LIBRARY MACRO)) {
278 $CONF{$u} = uniquefy_filenames( $CONF{$u} );
280 open( BASE_MMP, ">$base.mmp" ) or die "$0: $base.mmp: $!\n";
282 print BASE_MMP <<__EOF__;
285 TARGETPATH $CONF{TARGETPATH}
286 SOURCE @{$CONF{SOURCE}}
289 for my $u (qw(SOURCEPATH SYSTEMINCLUDE USERINCLUDE)) {
290 for my $v ( @{ $CONF{$u} } ) {
291 print BASE_MMP "$u\t$v\n";
294 # OPTION does not work in MMPs for pre-2.0 SDKs?
295 print BASE_MMP <<__EOF__;
296 LIBRARY @{$CONF{LIBRARY}}
297 MACRO @{$CONF{MACRO}}
298 // OPTION MSVC /P // Uncomment for creating .i (cpp'ed .cpp)
299 // OPTION GCC -E // Uncomment for creating .i (cpp'ed .cpp)
301 # if (-f "$base.rss") {
302 # print BASE_MMP "RESOURCE\t$base.rss\n";
309 my ( $base, $build ) = @_;
311 print "\tMakefile\n";
313 my $windef1 = "$SYMBIAN_ROOT\\Epoc32\\Build$CWD\\$base\\$WIN\\$base.def";
314 my $windef2 = "..\\BWINS\\${base}u.def";
315 my $armdef1 = "$SYMBIAN_ROOT\\Epoc32\\Build$CWD\\$base\\$ARM\\$base.def";
316 my $armdef2 = "..\\BMARM\\${base}u.def";
318 my $wrap = $SYMBIAN_ROOT && defined $SDK_VARIANT eq 'S60' && $SDK_VERSION eq '1.2' && $SYMBIAN_ROOT !~ /_CW$/;
319 my $ABLD = $wrap ? 'perl b.pl' : 'abld';
321 open( MAKEFILE, ">Makefile" ) or die "$0: Makefile: $!\n";
322 print MAKEFILE <<__EOF__;
329 sis: build_arm freeze_arm
331 build: abld.bat build_win build_arm
338 \$(ABLD) build \$(WIN) udeb
342 \$(ABLD) build \$(ARM) $UARM
344 win: build_win freeze_win
346 arm: build_arm freeze_arm
348 freeze: freeze_win freeze_arm
352 \$(ABLD) freeze \$(WIN) $base
356 \$(ABLD) freeze \$(ARM) $base
358 defrost: defrost_win defrost_arm
368 clean: clean_win clean_arm
371 \$(ABLD) clean \$(WIN)
374 \$(ABLD) clean \$(ARM)
376 realclean: clean realclean_win realclean_arm
378 -del /f $base.c $base.mmp
381 \$(ABLD) reallyclean \$(WIN)
384 \$(ABLD) reallyclean \$(ARM)
386 distclean: defrost realclean
387 -rmdir ..\\BWINS ..\\BMARM
388 -del /f const-c.inc const-xs.inc
389 -del /f Makefile abld.bat bld.inf
393 if(open(B,">b.pl")) {
397 # nmake doesn't like MFLAGS and MAKEFLAGS being set to -w and w.
399 delete $ENV{MAKEFLAGS};
401 print "abld @ARGV\n";
402 system_echo("abld @ARGV");
406 warn "$0: failed to create b.pl: $!\n";
412 print "[chdir from ", getcwd(), " to ";
413 chdir(shift) or return;
415 print getcwd(), "]\n";
419 my ( $ext, $dir ) = @_;
420 print "Configuring for $ext, directory '$dir'...\n";
421 my $extu = $CoreBuild ? "$BUILDROOT\\lib\\ExtUtils" : "$PERLSDK\\lib\\ExtUtils";
422 update_dir($dir) or die "$0: chdir '$dir': $!\n";
423 my $build = dirname($ext);
424 my $base = basename($ext);
425 my $basexs = "$base.xs";
426 my $basepm = "$base.pm";
427 my $basec = "$base$CSuffix";
429 if ( $dir =~ m:^ext\\(.+): ) {
432 elsif ( $dir ne "." ) {
435 my $extdirdir = dirname($extdir);
436 my $targetroot = "\\System\\Libs\\Perl\\$R_V_SV";
437 write_bld_inf($base) if -f $basexs;
442 $extdirdir = $extdirdir eq "." ? "" : "$extdirdir\\";
444 my $extdash = $ext; $extdash =~ s!\\!-!g;
447 $lst{"$UREL\\perl$VERSION-$extdash.dll"} =
448 "$targetroot\\$ARM-symbian\\$base.dll"
450 $lst{"$dir\\$base.pm"} = "$targetroot\\$extdirdir$base.pm"
451 if -f $basepm && $base ne 'XSLoader';
458 find( sub { push @found, $File::Find::name if -f $_ }, 'lib' );
459 for my $found (@found) {
460 next if $found =~ /\.bak$/i; # Zlib
461 my ($short) = ( $found =~ m/^lib.(.+)/ );
464 $lst{"$dir\\$found"} = "$targetroot\\$short";
467 if ( my @pm = glob("*.pm */*.pm") ) {
469 next if $pm =~ m:^t/:;
471 $lst{"$dir\\$pm"} = "$targetroot\\$extdirdir$pm";
474 if ( my @c = glob("*.c *.cpp */*.c */*.cpp") ) {
475 @c = grep { ! m:^zlib-src/: } @c if $ext eq 'ext\Compress\Zlib';
481 if ( my @h = glob("*.h */*.h") ) {
482 @h = grep { ! m:^zlib-src/: } @h if $ext eq 'ext\Compress\Zlib';
486 $incdir{"$dir\\$h"}++ unless $h eq ".";
489 if ( exists $EXTCFG{$ext} ) {
490 for my $cfg ( @{ $EXTCFG{$ext} } ) {
491 if ( $cfg =~ /^([-+])?(.+\.(c|cpp|h))$/ ) {
492 my $o = defined $1 ? $1 : '+';
495 for my $f ( glob($f) ) {
497 warn "$0: no source file $dir\\$f\n" unless -f $f;
498 $src{$f}++ unless $cfg =~ /\.h$/;
499 if ( $f =~ m:^(.+)\\[^\\]+$: ) {
503 elsif ( $o eq '-' ) {
508 if ( $cfg =~ /^([-+])?(.+\.(pm|pl|inc))$/ ) {
509 my $o = defined $1 ? $1 : '+';
512 for my $f ( glob($f) ) {
514 warn "$0: no Perl file $dir\\$f\n" unless -f $f;
515 $lst{"$dir\\$f"} = "$targetroot\\$extdir\\$f";
517 elsif ( $o eq '-' ) {
518 delete $lst{"$dir\\$f"};
522 if ( $cfg eq 'CONST' && !$ran_PL++ ) {
523 run_PL( "Makefile.PL", $dir, "const-xs.inc" );
527 unless ( $ran_PL++ ) {
528 run_PL( "Makefile.PL", $dir ) if -f "Makefile.PL";
530 if ( $dir eq "ext\\Errno" ) {
531 run_PL( "Errno_pm.PL", $dir, "Errno.pm" );
532 $lst{"$dir\\Errno.pm"} = "$targetroot\\Errno.pm";
534 elsif ( $dir eq "ext\\Devel\\PPPort" ) {
535 run_PL( "ppport_h.PL", $dir, "ppport.h" );
537 elsif ( $dir eq "ext\\DynaLoader" ) {
538 run_PL( "XSLoader_pm.PL", $dir, "XSLoader.pm" );
539 $lst{"ext\\DynaLoader\\XSLoader.pm"} = "$targetroot\\XSLoader.pm";
541 elsif ( $dir eq "ext\\Encode" ) {
542 system_echo("perl bin\\enc2xs -Q -O -o def_t.c -f def_t.fnm") == 0
543 or die "$0: running enc2xs failed: $!\n";
546 my @lst = sort keys %lst;
548 read_mmp( \%CONF, "_init.mmp" );
549 read_mmp( \%CONF, "$base.mmp" );
552 my %MM; # MakeMaker results
553 my @MM = qw(VERSION XS_VERSION);
554 if ( -f "Makefile" ) {
555 print "\tReading MakeMaker Makefile...\n";
556 if ( open( MAKEFILE, "Makefile" ) ) {
568 warn "$0: Makefile: $!";
570 print "\tDeleting MakeMaker Makefile.\n";
576 if ( defined $CONF{EXTVERSION} ) {
577 my $EXTVERSION = $CONF{EXTVERSION};
578 print "\tUsing $EXTVERSION for version...\n";
579 $MM{VERSION} = $MM{XS_VERSION} = $EXTVERSION;
581 die "$0: VERSION or XS_VERSION undefined\n"
582 unless defined $MM{VERSION} && defined $MM{XS_VERSION};
583 if ( open( BASE_C, ">$basec" ) ) {
584 print BASE_C <<__EOF__;
586 #define VERSION "$MM{VERSION}"
589 #define XS_VERSION "$MM{XS_VERSION}"
595 warn "$0: $basec: $!";
599 "perl -I$BUILDROOT\\lib -I$PERLSDK\\lib $extu\\xsubpp -csuffix .cpp -typemap $extu\\typemap -noprototypes $basexs >> $basec"
604 die "$0: perl xsubpp failed: $!\n";
608 open( _INIT_C, ">_init.c" ) or die "$!: _init.c: $!\n";
609 print _INIT_C <<__EOF__;
612 EXPORT_C void _init(void *handle) {
617 my @src = ( "_init.c", sort keys %src );
619 if ( $base eq "Encode" ) { # Currently unused.
620 for my $submf ( glob("*/Makefile") ) {
621 my $d = dirname($submf);
622 print "Configuring Encode::$d...\n";
623 if ( open( SUBMF, $submf ) ) {
624 if ( update_dir($d) ) {
627 next if 1 .. /postamble/;
628 if (m!^(\w+_t)\.c : !) {
630 "perl ..\\bin\\enc2xs -Q -o $1.c -f $1.fnm")
632 or warn "$0: enc2xs: $!\n";
633 push @subsrc, "$1.c";
639 $subbase =~ s!/!::!g;
640 write_mmp( $ext, $subbase, ["..\\Encode"], "$subbase.c",
642 write_makefile( $subbase, $build );
643 write_bld_inf($subbase);
647 "perl -I$BUILDROOT\\lib ..\\$extu\\xsubpp -csuffix .cpp -typemap ..\\$extu\\typemap -noprototypes $subbase.xs > $subbase.c"
652 die "$0: perl xsubpp failed: $!\n";
657 warn "$0: chdir $d: $!\n";
661 warn "$0: $submf: $!";
664 print "Configuring Encode...\n";
667 write_mmp( $ext, $base, [ keys %incdir ], @src );
668 write_makefile( $base, $build );
671 $lstname =~ s:^ext\\::;
672 $lstname =~ s:\\:-:g;
673 print "\t$lstname.lst\n";
675 $CoreBuild ? "$BUILDROOT/symbian/$lstname.lst" : "$BUILDROOT/$lstname.lst";
676 if ( open( my $lst, ">$lstout" ) ) {
677 for my $f (@lst) { print $lst qq["$f"-"!:$lst{$f}"\n] }
681 die "$0: $lstout: $!\n";
683 update_dir($BUILDROOT);
692 for my $ext (@ARGV) {
695 my $extdash = $ext =~ /ext\\/ ? $ext : "ext\\$ext"; $extdash =~ s!\\!-!g;
700 $cfg = $2 if $ext =~ s/(.+?),(.+)/$1/;
705 if ( $ext =~ /\.xs$/ && !-f $ext ) {
706 if ( -f "ext\\$ext" ) {
708 $dir = dirname($ext);
712 if ( -d "ext\\$ext" ) {
717 $dir = "." unless defined $dir;
720 if ( $ext =~ /\.xs$/ && -f $ext ) {
721 $ext = dirname($ext);
729 if ( $ext eq "XSLoader" ) {
730 $ext = "ext\\XSLoader";
732 if ( $ext eq "ext\\XSLoader" ) {
733 $dir = "ext\\DynaLoader";
736 $EXTCFG{$ext} = [ split( /,/, $cfg ) ] if defined $cfg;
738 die "$0: no lib\\Config.pm\n"
739 if $CoreBuild && $Build && !-f "lib\\Config.pm";
742 open( my $cfg, "symbian/install.cfg" )
743 or die "$0: symbian/install.cfg: $!\n";
745 $extdir =~ s:^ext\\::;
747 next unless /^ext\s+(.+)/;
750 my @ext = split( ' ', $ext );
751 $EXTCFG{"ext\\$ext[0]"} = [@ext];
756 if ( $Config || $Build ) {
757 xsconfig( $ext, $dir ) or die "$0: xsconfig '$ext' failed\n";
762 warn "$0: No directory for $ext, skipping...\n";
766 my $chdir = $ext eq "ext\\XSLoader" ? "ext\\DynaLoader" : $dir;
767 die "$0: no directory '$chdir'\n" unless -d $chdir;
768 update_dir($chdir) or die "$0: chdir '$chdir' failed: $!\n";
772 my @ext = split( /\\/, $ext );
775 if ( $Clean || $DistClean ) {
776 print "Cleaning $ext...\n";
780 unlink("const-c.inc");
781 unlink("const-xs.inc");
785 if ( $Build && $ext ne "ext\\XSLoader" && $ext ne "ext\\Errno" ) {
787 # We compile the extension three (3) times.
788 # (1) Only the _init.c to get _init() as the ordinal 1 function in the DLL.
789 # (2) With the rest and the _init.c to get ordinals for the rest.
790 # (3) With an updated _init.c that carries the symbols from step (2).
792 system_echo("make clean");
793 system_echo("make defrost") == 0 or warn "$0: make defrost failed\n";
797 push @TARGET, 'sis' if $Sis;
800 # Hide all but the _init.c.
801 print "\n*** $ext - Compile 1 of 3.\n\n";
802 print "(patching $base.mmp)\n";
804 "perl -pi.bak -e \"s:^SOURCE\\s+_init.c:SOURCE\\t_init.c // :\" $base.mmp"
806 system_echo("bldmake bldfiles");
807 system_echo("make @TARGET") == 0 or die "$0: make #1 failed\n";
810 # Reveal the rest again.
811 print "\n*** $ext - Compile 2 of 3.\n\n";
812 print "(patching $base.mmp)\n";
814 "perl -pi.bak -e \"s:^SOURCE\\t_init.c // :SOURCE\\t_init.c :\" $base.mmp"
816 system_echo("make @TARGET") == 0 or die "$0: make #2 failed\n";
817 unlink("$base.mmp.bak");
819 open( _INIT_C, ">_init.c" ) or die "$0: _init.c: $!\n";
820 print _INIT_C <<'__EOF__';
824 /* This is a different but matching definition from in dl_symbian.xs. */
829 } PerlSymbianLibHandle;
831 EXPORT_C void _init(void* handle) {
837 for my $f ("$SYMBIAN_ROOT\\Epoc32\\Build$CWD\\$base\\WINS\\perl$VERSION-$extdash.def",
838 "..\\BMARM\\perl$VERSION-${extdash}u.def") {
840 if ( open( $def, $f ) ) {
848 unless (defined $basef) {
849 die "$0: failed to find .def for $base\n";
852 next while 1 .. /^EXPORTS/;
853 if (/^\s*(\w+) \@ (\d+) /) {
859 my @symbol = sort keys %symbol;
861 print _INIT_C <<'__EOF__';
863 PerlSymbianLibHandle* h = (PerlSymbianLibHandle*)handle;
865 h->symbols = newHV();
868 for my $sym (@symbol) {
869 my $len = length($sym);
870 print _INIT_C <<__EOF__;
871 hv_store(h->symbols, "$sym", $len, newSViv($symbol{$sym}), 0);
876 die "$0: $basef: no exports found\n";
879 print _INIT_C <<'__EOF__';
885 # Compile #3. This is for real.
886 print "\n*** $ext - Compile 3 of 3.\n\n";
887 system_echo("make @TARGET") == 0 or die "$0: make #3 failed\n";
890 elsif ( $Clean || $DistClean ) {
891 if ( $ext eq "ext\\Errno" ) {
892 unlink( "Errno.pm", "Makefile" );
895 if ( -f "Makefile" ) {
897 system_echo("make clean") == 0 or die "$0: make clean failed\n";
900 system_echo("make distclean") == 0
901 or die "$0: make distclean failed\n";
904 if ( $ext eq "ext\\Compress\\Zlib" ) {
906 find( sub { push @bak, $File::Find::name if /\.bak$/ }, "." );
907 unlink(@bak) if @bak;
909 find( sub { push @src, $_ if -f $_ }, "zlib-src" );
910 unlink(@src) if @src;
911 unlink("constants.xs");
913 if ( $ext eq "ext\\Devel\\PPPort" ) {
917 my @D = glob("../BMARM/*.def ../BWINS/*.def");
919 my @B = glob("ext/BWINS ext/BMARM ext/*/BWINS ext/*/BMARM Makefile");
923 update_dir($BUILDROOT);