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]
38 [--csuffix=csuffix] [--cplusplus]
39 [--win=win] [--arm=arm]
40 [--config|--build|--clean|--distclean|--sis] ext
51 my $BUILDROOT = getcwd();
53 if ( !defined $PerlVersion && $0 =~ m:\\symbian\\perl\\(.+)\\bin\\xsbuild.pl:i )
58 if ( !defined $SymbianVersion) {
59 ($SymbianVersion) = ($ENV{PATH} =~ m!\\Symbian\\(.+?)\\!i);
62 my ($SYMBIAN_ROOT, $SYMBIAN_VERSION, $SDK_NAME, $SDK_VARIANT, $SDK_VERSION);
65 unshift @INC, "symbian";
67 my %VERSION = %{ do "version.pl" };
68 ($SYMBIAN_ROOT, $SYMBIAN_VERSION, $SDK_NAME, $SDK_VARIANT, $SDK_VERSION) =
70 $VERSION = "$VERSION{REVISION}$VERSION{VERSION}$VERSION{SUBVERSION}";
71 $R_V_SV = "$VERSION{REVISION}.$VERSION{VERSION}.$VERSION{SUBVERSION}";
72 $BUILDROOT = do "cwd.pl";
73 $PerlVersion = $R_V_SV;
78 'symbian=s' => \$SymbianVersion,
79 'perl=s' => \$PerlVersion,
80 'csuffix=s' => \$CSuffix,
81 'cplusplus' => \$CPlusPlus,
87 'distclean' => \$DistClean,
93 $CSuffix = '.cpp' if $CPlusPlus;
94 $Build = !( $Config || $Clean || $DistClean ) || $Sis unless defined $Build;
96 die "$0: Symbian version undefined\n" unless defined $SymbianVersion;
98 $SymbianVersion =~ s:/:\\:g;
100 die "$0: Symbian version '$SymbianVersion' not found\n"
101 unless -d "\\Symbian\\$SymbianVersion";
103 die "$0: Perl version undefined\n" unless defined $PerlVersion;
105 die "$0: Perl version '$PerlVersion' not found\n"
106 if !$CoreBuild && !-d "\\Symbian\\Perl\\$PerlVersion";
108 print "Configuring with Symbian $SymbianVersion and Perl $PerlVersion...\n";
110 $PERLSDK = "\\Symbian\\Perl\\$PerlVersion";
112 $R_V_SV = $PerlVersion;
114 $VERSION = $PerlVersion unless defined $VERSION;
116 $VERSION =~ tr/.//d if defined $VERSION;
118 $ENV{SDK} = $SYMBIAN_ROOT; # For the Errno extension
119 $ENV{CROSS} = 1; # For the Encode extension (unbuilt now)
122 my $UREL = "$SYMBIAN_ROOT\\epoc32\\release\\-ARM-\\$UARM";
124 if (exists $ENV{UREL}) {
125 $UREL = $ENV{UREL}; # from sdk.pl
126 $UREL =~ s/-ARM-/$ARM/;
127 $UARM = $ENV{UARM}; # from sdk.pl
128 $SRCDBG = $UARM eq 'udeb' ? "SRCDBG" : "";
137 open( BLD_INF, ">bld.inf" ) or die "$0: bld.inf: $!\n";
138 print BLD_INF <<__EOF__;
149 print "xsbuild: ", $cmd, "\n";
154 my ( $PL, $dir, $file ) = @_;
155 if ( defined $file ) {
156 print "\t(Running $dir\\$PL to create $file)\n";
160 print "\t(Running $dir\\$PL)\n";
164 # Problem: the Config.pm we have in $BUILDROOT\\lib carries the
165 # version number of the Perl we are building, while the Perl
166 # we are running might have some other version. Solution:
167 # temporarily replace the Config.pm with a patched version.
168 my $V = sprintf "%vd", $^V;
169 unlink("$BUILDROOT\\lib\\Config.pm.bak");
170 print "(patching $BUILDROOT\\lib\\Config.pm)\n";
171 system_echo("perl -pi.bak -e \"s:\\Q$R_V_SV:$V:\" $BUILDROOT\\lib\\Config.pm");
173 system_echo("perl -I$BUILDROOT\\lib -I$BUILDROOT\\xlib\\symbian -I$BUILDROOT\\t\\lib $PL") == 0
174 or warn "$0: $PL failed.\n";
176 system_echo("copy $BUILDROOT\\lib\\Config.pm.bak $BUILDROOT\\lib\\Config.pm");
178 if ( defined $file ) { -s $file or die "$0: No $file created.\n" }
182 my ( $conf, $k ) = @_;
183 push @{ $conf->{$k} }, split( ' ', $1 ) if /^$k\s(.+)$/;
186 sub uniquefy_filenames {
189 for my $i (@{$_[0]}) {
191 $i = lc $i if $i =~ m!\\!;
193 push @$b, $i unless $c{$i}++;
199 my ( $conf, $mmp ) = @_;
200 if ( -r $mmp && open( MMP, "<$mmp" ) ) {
201 print "\tReading $mmp...\n";
204 $conf->{TARGET} = $1 if /^TARGET\s+(.+)$/;
205 $conf->{TARGETPATH} = $1 if /^TARGETPATH\s+(.+)$/;
206 $conf->{EXTVERSION} = $1 if /^EXTVERSION\s+(.+)$/;
207 read_old_multi( $conf, "SOURCE" );
208 read_old_multi( $conf, "SOURCEPATH" );
209 read_old_multi( $conf, "USERINCLUDE" );
210 read_old_multi( $conf, "SYSTEMINCLUDE" );
211 read_old_multi( $conf, "LIBRARY" );
212 read_old_multi( $conf, "MACRO" );
219 my ( $ext, $base, $userinclude, @src ) = @_;
221 my $extdash = $ext; $extdash =~ s!\\!-!g;
223 print "\t$base.mmp\n";
224 $CONF{TARGET} = "perl$VERSION-$extdash.dll";
225 $CONF{TARGETPATH} = "\\System\\Libs\\Perl\\$R_V_SV";
226 $CONF{SOURCE} = [@src];
227 $CONF{SOURCEPATH} = [ $CWD, $BUILDROOT ];
228 $CONF{USERINCLUDE} = [ $CWD, $BUILDROOT ];
229 $CONF{SYSTEMINCLUDE} = ["$PERLSDK\\include"] unless $CoreBuild;
230 $CONF{SYSTEMINCLUDE} = [ $BUILDROOT, "$BUILDROOT\\symbian" ] if $CoreBuild;
233 read_mmp( \%CONF, "_init.mmp" );
234 read_mmp( \%CONF, "$base.mmp" );
236 if ($base eq 'Zlib') {
237 push @{$CONF{USERINCLUDE}}, "$CWD\\zlib-src";
240 for my $ui ( @{$userinclude} ) {
242 if ( $ui =~ m!^(?:[CD]:)?\\! ) {
243 push @{ $CONF{USERINCLUDE} }, $ui;
246 push @{ $CONF{USERINCLUDE} }, "$BUILDROOT\\$ui";
249 push @{ $CONF{SYSTEMINCLUDE} }, "\\epoc32\\include";
250 push @{ $CONF{SYSTEMINCLUDE} }, "\\epoc32\\include\\libc";
251 push @{ $CONF{LIBRARY} }, "euser.lib";
252 push @{ $CONF{LIBRARY} }, "estlib.lib";
253 push @{ $CONF{LIBRARY} }, "perl$VERSION.lib";
254 push @{ $CONF{MACRO} }, "SYMBIAN" unless $CoreBuild;
255 push @{ $CONF{MACRO} }, "PERL_EXT" if $CoreBuild;
256 push @{ $CONF{MACRO} }, "MULTIPLICITY";
257 push @{ $CONF{MACRO} }, "PERL_IMPLICIT_CONTEXT";
258 push @{ $CONF{MACRO} }, "PERL_GLOBAL_STRUCT";
259 push @{ $CONF{MACRO} }, "PERL_GLOBAL_STRUCT_PRIVATE";
261 if ($SDK_VARIANT eq 'S60') {
262 push @{ $CONF{MACRO} }, '__SERIES60__'
263 unless grep { $_ eq '__SERIES60__' } @{ $CONF{MACRO} };
265 if ($SDK_VARIANT eq 'S80') {
266 push @{ $CONF{MACRO} }, '__SERIES80__'
267 unless grep { $_ eq '__SERIES80__' } @{ $CONF{MACRO} };
269 if ($SDK_VARIANT eq 'UIQ') {
270 push @{ $CONF{MACRO} }, '__UIQ__'
271 unless grep { $_ eq '__UIQ__' } @{ $CONF{MACRO} };
274 for my $u (qw(SOURCE SOURCEPATH SYSTEMINCLUDE USERINCLUDE LIBRARY MACRO)) {
275 $CONF{$u} = uniquefy_filenames( $CONF{$u} );
277 open( BASE_MMP, ">$base.mmp" ) or die "$0: $base.mmp: $!\n";
279 print BASE_MMP <<__EOF__;
282 TARGETPATH $CONF{TARGETPATH}
283 SOURCE @{$CONF{SOURCE}}
286 for my $u (qw(SOURCEPATH SYSTEMINCLUDE USERINCLUDE)) {
287 for my $v ( @{ $CONF{$u} } ) {
288 print BASE_MMP "$u\t$v\n";
291 # OPTION does not work in MMPs for pre-2.0 SDKs?
292 print BASE_MMP <<__EOF__;
293 LIBRARY @{$CONF{LIBRARY}}
294 MACRO @{$CONF{MACRO}}
295 // OPTION MSVC /P // Uncomment for creating .i (cpp'ed .cpp)
296 // OPTION GCC -E // Uncomment for creating .i (cpp'ed .cpp)
298 # if (-f "$base.rss") {
299 # print BASE_MMP "RESOURCE\t$base.rss\n";
306 my ( $base, $build ) = @_;
308 print "\tMakefile\n";
310 my $windef1 = "$SYMBIAN_ROOT\\Epoc32\\Build$CWD\\$base\\$WIN\\$base.def";
311 my $windef2 = "..\\BWINS\\${base}u.def";
312 my $armdef1 = "$SYMBIAN_ROOT\\Epoc32\\Build$CWD\\$base\\$ARM\\$base.def";
313 my $armdef2 = "..\\BMARM\\${base}u.def";
315 my $wrap = $SYMBIAN_ROOT && defined $SDK_VARIANT eq 'S60' && $SDK_VERSION eq '1.2' && $SYMBIAN_ROOT !~ /_CW$/;
316 my $ABLD = $wrap ? 'perl b.pl' : 'abld';
318 open( MAKEFILE, ">Makefile" ) or die "$0: Makefile: $!\n";
319 print MAKEFILE <<__EOF__;
326 sis: build_arm freeze_arm
328 build: abld.bat build_win build_arm
335 \$(ABLD) build \$(WIN) udeb
339 \$(ABLD) build \$(ARM) $UARM
341 win: build_win freeze_win
343 arm: build_arm freeze_arm
345 freeze: freeze_win freeze_arm
349 \$(ABLD) freeze \$(WIN) $base
353 \$(ABLD) freeze \$(ARM) $base
355 defrost: defrost_win defrost_arm
365 clean: clean_win clean_arm
368 \$(ABLD) clean \$(WIN)
371 \$(ABLD) clean \$(ARM)
373 realclean: clean realclean_win realclean_arm
375 -del /f $base.c $base.mmp
378 \$(ABLD) reallyclean \$(WIN)
381 \$(ABLD) reallyclean \$(ARM)
383 distclean: defrost realclean
384 -rmdir ..\\BWINS ..\\BMARM
385 -del /f const-c.inc const-xs.inc
386 -del /f Makefile abld.bat bld.inf
390 if(open(B,">b.pl")) {
394 # nmake doesn't like MFLAGS and MAKEFLAGS being set to -w and w.
396 delete $ENV{MAKEFLAGS};
398 print "abld @ARGV\n";
399 system_echo("abld @ARGV");
403 warn "$0: failed to create b.pl: $!\n";
409 print "[chdir from ", getcwd(), " to ";
410 chdir(shift) or return;
412 print getcwd(), "]\n";
416 my ( $ext, $dir ) = @_;
417 print "Configuring for $ext, directory '$dir'...\n";
418 my $extu = $CoreBuild ? "$BUILDROOT\\lib\\ExtUtils" : "$PERLSDK\\lib\\ExtUtils";
419 update_dir($dir) or die "$0: chdir '$dir': $!\n";
420 my $build = dirname($ext);
421 my $base = basename($ext);
422 my $basexs = "$base.xs";
423 my $basepm = "$base.pm";
424 my $basec = "$base$CSuffix";
426 if ( $dir =~ m:^ext\\(.+): ) {
429 elsif ( $dir ne "." ) {
432 my $extdirdir = dirname($extdir);
433 my $targetroot = "\\System\\Libs\\Perl\\$R_V_SV";
434 write_bld_inf($base) if -f $basexs;
439 $extdirdir = $extdirdir eq "." ? "" : "$extdirdir\\";
441 my $extdash = $ext; $extdash =~ s!\\!-!g;
444 $lst{"$UREL\\perl$VERSION-$extdash.dll"} =
445 "$targetroot\\$ARM-symbian\\$base.dll"
447 $lst{"$dir\\$base.pm"} = "$targetroot\\$extdirdir$base.pm"
448 if -f $basepm && $base ne 'XSLoader';
455 find( sub { push @found, $File::Find::name if -f $_ }, 'lib' );
456 for my $found (@found) {
457 next if $found =~ /\.bak$/i; # Zlib
458 my ($short) = ( $found =~ m/^lib.(.+)/ );
461 $lst{"$dir\\$found"} = "$targetroot\\$short";
464 if ( my @pm = glob("*.pm */*.pm") ) {
466 next if $pm =~ m:^t/:;
468 $lst{"$dir\\$pm"} = "$targetroot\\$extdirdir$pm";
471 if ( my @c = glob("*.c *.cpp */*.c */*.cpp") ) {
472 @c = grep { ! m:^zlib-src/: } @c if $ext eq 'ext\Compress\Zlib';
478 if ( my @h = glob("*.h */*.h") ) {
479 @h = grep { ! m:^zlib-src/: } @h if $ext eq 'ext\Compress\Zlib';
483 $incdir{"$dir\\$h"}++ unless $h eq ".";
486 if ( exists $EXTCFG{$ext} ) {
487 for my $cfg ( @{ $EXTCFG{$ext} } ) {
488 if ( $cfg =~ /^([-+])?(.+\.(c|cpp|h))$/ ) {
489 my $o = defined $1 ? $1 : '+';
492 for my $f ( glob($f) ) {
494 warn "$0: no source file $dir\\$f\n" unless -f $f;
495 $src{$f}++ unless $cfg =~ /\.h$/;
496 if ( $f =~ m:^(.+)\\[^\\]+$: ) {
500 elsif ( $o eq '-' ) {
505 if ( $cfg =~ /^([-+])?(.+\.(pm|pl|inc))$/ ) {
506 my $o = defined $1 ? $1 : '+';
509 for my $f ( glob($f) ) {
511 warn "$0: no Perl file $dir\\$f\n" unless -f $f;
512 $lst{"$dir\\$f"} = "$targetroot\\$extdir\\$f";
514 elsif ( $o eq '-' ) {
515 delete $lst{"$dir\\$f"};
519 if ( $cfg eq 'CONST' && !$ran_PL++ ) {
520 run_PL( "Makefile.PL", $dir, "const-xs.inc" );
524 unless ( $ran_PL++ ) {
525 run_PL( "Makefile.PL", $dir ) if -f "Makefile.PL";
527 if ( $dir eq "ext\\Errno" ) {
528 run_PL( "Errno_pm.PL", $dir, "Errno.pm" );
529 $lst{"$dir\\Errno.pm"} = "$targetroot\\Errno.pm";
531 elsif ( $dir eq "ext\\Devel\\PPPort" ) {
532 run_PL( "ppport_h.PL", $dir, "ppport.h" );
534 elsif ( $dir eq "ext\\DynaLoader" ) {
535 run_PL( "XSLoader_pm.PL", $dir, "XSLoader.pm" );
536 $lst{"ext\\DynaLoader\\XSLoader.pm"} = "$targetroot\\XSLoader.pm";
538 elsif ( $dir eq "ext\\Encode" ) {
539 system_echo("perl bin\\enc2xs -Q -O -o def_t.c -f def_t.fnm") == 0
540 or die "$0: running enc2xs failed: $!\n";
543 my @lst = sort keys %lst;
545 read_mmp( \%CONF, "_init.mmp" );
546 read_mmp( \%CONF, "$base.mmp" );
549 my %MM; # MakeMaker results
550 my @MM = qw(VERSION XS_VERSION);
551 if ( -f "Makefile" ) {
552 print "\tReading MakeMaker Makefile...\n";
553 if ( open( MAKEFILE, "Makefile" ) ) {
565 warn "$0: Makefile: $!";
567 print "\tDeleting MakeMaker Makefile.\n";
573 if ( defined $CONF{EXTVERSION} ) {
574 my $EXTVERSION = $CONF{EXTVERSION};
575 print "\tUsing $EXTVERSION for version...\n";
576 $MM{VERSION} = $MM{XS_VERSION} = $EXTVERSION;
578 die "$0: VERSION or XS_VERSION undefined\n"
579 unless defined $MM{VERSION} && defined $MM{XS_VERSION};
580 if ( open( BASE_C, ">$basec" ) ) {
581 print BASE_C <<__EOF__;
583 #define VERSION "$MM{VERSION}"
586 #define XS_VERSION "$MM{XS_VERSION}"
592 warn "$0: $basec: $!";
596 "perl -I$BUILDROOT\\lib -I$PERLSDK\\lib $extu\\xsubpp -csuffix .cpp -typemap $extu\\typemap -noprototypes $basexs >> $basec"
601 die "$0: perl xsubpp failed: $!\n";
605 open( _INIT_C, ">_init.c" ) or die "$!: _init.c: $!\n";
606 print _INIT_C <<__EOF__;
609 EXPORT_C void _init(void *handle) {
614 my @src = ( "_init.c", sort keys %src );
616 if ( $base eq "Encode" ) { # Currently unused.
617 for my $submf ( glob("*/Makefile") ) {
618 my $d = dirname($submf);
619 print "Configuring Encode::$d...\n";
620 if ( open( SUBMF, $submf ) ) {
621 if ( update_dir($d) ) {
624 next if 1 .. /postamble/;
625 if (m!^(\w+_t)\.c : !) {
627 "perl ..\\bin\\enc2xs -Q -o $1.c -f $1.fnm")
629 or warn "$0: enc2xs: $!\n";
630 push @subsrc, "$1.c";
636 $subbase =~ s!/!::!g;
637 write_mmp( $ext, $subbase, ["..\\Encode"], "$subbase.c",
639 write_makefile( $subbase, $build );
640 write_bld_inf($subbase);
644 "perl -I$BUILDROOT\\lib ..\\$extu\\xsubpp -csuffix .cpp -typemap ..\\$extu\\typemap -noprototypes $subbase.xs > $subbase.c"
649 die "$0: perl xsubpp failed: $!\n";
654 warn "$0: chdir $d: $!\n";
658 warn "$0: $submf: $!";
661 print "Configuring Encode...\n";
664 write_mmp( $ext, $base, [ keys %incdir ], @src );
665 write_makefile( $base, $build );
668 $lstname =~ s:^ext\\::;
669 $lstname =~ s:\\:-:g;
670 print "\t$lstname.lst\n";
672 $CoreBuild ? "$BUILDROOT/symbian/$lstname.lst" : "$BUILDROOT/$lstname.lst";
673 if ( open( my $lst, ">$lstout" ) ) {
674 for my $f (@lst) { print $lst qq["$f"-"!:$lst{$f}"\n] }
678 die "$0: $lstout: $!\n";
680 update_dir($BUILDROOT);
689 for my $ext (@ARGV) {
692 my $extdash = "ext\\$ext"; $extdash =~ s!\\!-!g;
697 $cfg = $2 if $ext =~ s/(.+?),(.+)/$1/;
702 if ( $ext =~ /\.xs$/ && !-f $ext ) {
703 if ( -f "ext\\$ext" ) {
705 $dir = dirname($ext);
709 if ( -d "ext\\$ext" ) {
714 $dir = "." unless defined $dir;
717 if ( $ext =~ /\.xs$/ && -f $ext ) {
718 $ext = dirname($ext);
726 if ( $ext eq "XSLoader" ) {
727 $ext = "ext\\XSLoader";
729 if ( $ext eq "ext\\XSLoader" ) {
730 $dir = "ext\\DynaLoader";
733 $EXTCFG{$ext} = [ split( /,/, $cfg ) ] if defined $cfg;
735 die "$0: no lib\\Config.pm\n"
736 if $CoreBuild && $Build && !-f "lib\\Config.pm";
739 open( my $cfg, "symbian/install.cfg" )
740 or die "$0: symbian/install.cfg: $!\n";
742 $extdir =~ s:^ext\\::;
744 next unless /^ext\s+(.+)/;
747 my @ext = split( ' ', $ext );
748 $EXTCFG{"ext\\$ext[0]"} = [@ext];
753 if ( $Config || $Build ) {
754 xsconfig( $ext, $dir ) or die "$0: xsconfig '$ext' failed\n";
759 warn "$0: No directory for $ext, skipping...\n";
763 my $chdir = $ext eq "ext\\XSLoader" ? "ext\\DynaLoader" : $dir;
764 die "$0: no directory '$chdir'\n" unless -d $chdir;
765 update_dir($chdir) or die "$0: chdir '$chdir' failed: $!\n";
769 my @ext = split( /\\/, $ext );
772 if ( $Clean || $DistClean ) {
773 print "Cleaning $ext...\n";
777 unlink("const-c.inc");
778 unlink("const-xs.inc");
782 if ( $Build && $ext ne "ext\\XSLoader" && $ext ne "ext\\Errno" ) {
784 # We compile the extension three (3) times.
785 # (1) Only the _init.c to get _init() as the ordinal 1 function in the DLL.
786 # (2) With the rest and the _init.c to get ordinals for the rest.
787 # (3) With an updated _init.c that carries the symbols from step (2).
789 system_echo("make clean");
790 system_echo("make defrost") == 0 or warn "$0: make defrost failed\n";
794 push @TARGET, 'sis' if $Sis;
797 # Hide all but the _init.c.
798 print "\n*** $ext - Compile 1 of 3.\n\n";
799 print "(patching $base.mmp)\n";
801 "perl -pi.bak -e \"s:^SOURCE\\s+_init.c:SOURCE\\t_init.c // :\" $base.mmp"
803 system_echo("bldmake bldfiles");
804 system_echo("make @TARGET") == 0 or die "$0: make #1 failed\n";
807 # Reveal the rest again.
808 print "\n*** $ext - Compile 2 of 3.\n\n";
809 print "(patching $base.mmp)\n";
811 "perl -pi.bak -e \"s:^SOURCE\\t_init.c // :SOURCE\\t_init.c :\" $base.mmp"
813 system_echo("make @TARGET") == 0 or die "$0: make #2 failed\n";
814 unlink("$base.mmp.bak");
816 open( _INIT_C, ">_init.c" ) or die "$0: _init.c: $!\n";
817 print _INIT_C <<'__EOF__';
821 /* This is a different but matching definition from in dl_symbian.xs. */
826 } PerlSymbianLibHandle;
828 EXPORT_C void _init(void* handle) {
834 for my $f ("$SYMBIAN_ROOT\\Epoc32\\Build$CWD\\$base\\WINS\\perl$VERSION-$extdash.def",
835 "..\\BMARM\\perl$VERSION-${extdash}u.def") {
837 if ( open( $def, $f ) ) {
845 unless (defined $basef) {
846 die "$0: failed to find .def for $base\n";
849 next while 1 .. /^EXPORTS/;
850 if (/^\s*(\w+) \@ (\d+) /) {
856 my @symbol = sort keys %symbol;
858 print _INIT_C <<'__EOF__';
860 PerlSymbianLibHandle* h = (PerlSymbianLibHandle*)handle;
862 h->symbols = newHV();
865 for my $sym (@symbol) {
866 my $len = length($sym);
867 print _INIT_C <<__EOF__;
868 hv_store(h->symbols, "$sym", $len, newSViv($symbol{$sym}), 0);
873 die "$0: $basef: no exports found\n";
876 print _INIT_C <<'__EOF__';
882 # Compile #3. This is for real.
883 print "\n*** $ext - Compile 3 of 3.\n\n";
884 system_echo("make @TARGET") == 0 or die "$0: make #3 failed\n";
887 elsif ( $Clean || $DistClean ) {
888 if ( $ext eq "ext\\Errno" ) {
889 unlink( "Errno.pm", "Makefile" );
892 if ( -f "Makefile" ) {
894 system_echo("make clean") == 0 or die "$0: make clean failed\n";
897 system_echo("make distclean") == 0
898 or die "$0: make distclean failed\n";
901 if ( $ext eq "ext\\Compress\\Zlib" ) {
903 find( sub { push @bak, $File::Find::name if /\.bak$/ }, "." );
904 unlink(@bak) if @bak;
906 find( sub { push @src, $_ if -f $_ }, "zlib-src" );
907 unlink(@src) if @src;
908 unlink("constants.xs");
910 if ( $ext eq "ext\\Devel\\PPPort" ) {
914 my @D = glob("../BMARM/*.def ../BWINS/*.def");
916 my @B = glob("ext/BWINS ext/BMARM ext/*/BWINS ext/*/BMARM Makefile");
920 update_dir($BUILDROOT);