3 # Copyright (c) 2004-2005 Nokia. All rights reserved.
4 # This utility is licensed under the same terms as Perl itself.
9 print "Configuring...\n";
10 print "Configuring with: Perl version $] ($^X)\n";
14 my %VERSION = %{ do "version.pl" };
16 printf "Configuring for: Perl version $VERSION{REVISION}.%03d%03d\n",
17 $VERSION{VERSION}, $VERSION{SUBVERSION};
19 my $VERSION = "$VERSION{REVISION}$VERSION{VERSION}$VERSION{SUBVERSION}";
20 my $R_V_SV = "$VERSION{REVISION}.$VERSION{VERSION}.$VERSION{SUBVERSION}";
22 my ($SYMBIAN_ROOT, $SYMBIAN_VERSION, $SDK_NAME, $SDK_VARIANT, $SDK_VERSION) =
24 my %PORT = %{ do "port.pl" };
26 if ($SYMBIAN_ROOT eq 'C:\Symbian\Series60_1_2_CW') {
27 ( $SYMBIAN_VERSION, $SDK_VERSION ) = qw(6.1 1.2);
30 my $WIN = $ENV{WIN} ; # 'wins', 'winscw' (from sdk.pl)
31 my $ARM = 'thumb'; # 'thumb', 'armv5'
32 my $S60SDK = $ENV{S60SDK}; # qw(1.2 2.0 2.1 2.6) (from sdk.pl)
33 my $S80SDK = $ENV{S80SDK}; # qw(2.0) (from sdk.pl)
34 my $UIQSDK = $ENV{UIQSDK}; # qw(2.0 2.1) (from sdk.pl)
36 my $UREL = $ENV{UREL}; # from sdk.pl
37 $UREL =~ s/-ARM-/$ARM/;
38 my $UARM = $ENV{UARM}; # from sdk.pl
40 die "$0: SDK not recognized\n"
41 if !defined($SYMBIAN_VERSION) ||
42 !defined($SDK_VERSION) ||
43 (!defined($S60SDK) && !defined($S80SDK) && !defined($UIQSDK));
45 die "$0: does not know which Windows compiler to use\n"
48 print "Symbian $SYMBIAN_VERSION SDK $SDK_VARIANT $SDK_VERSION ($WIN) installed at $SYMBIAN_ROOT\n";
50 my $CWD = do "cwd.pl";
51 print "Build directory $CWD\n";
53 die "$0: '+' in cwd does not work with Series 60 SDK 1.2\n"
54 if defined $S60SDK && $S60SDK eq '1.2' && $CWD =~ /\+/;
60 my ( $target, $type, @x ) = @_;
61 my $miniperl = $target eq 'miniperl';
62 my $perl = $target eq 'perl';
63 my $mmp = "$target.mmp";
64 my $targetpath = $miniperl
65 || $perl ? "TARGETPATH\t\\System\\Apps\\Perl" : "";
66 if ( open( my $fh, ">$mmp" ) ) {
74 EPOCHEAPSIZE 1024 8388608
79 if ($SDK_VARIANT eq 'S60') {
80 print $fh "MACRO\t__SERIES60__\n";
81 print $fh "MACRO\t__SERIES60_1X__\n" if $S60SDK =~ /^1\./;
82 print $fh "MACRO\t__SERIES60_2X__\n" if $S60SDK =~ /^2\./;
84 if ($SDK_VARIANT eq 'S80') {
85 print $fh "MACRO\t__SERIES80__\n";
86 print $fh "MACRO\t__SERIES80_1X__\n" if $S80SDK =~ /^1\./;
87 print $fh "MACRO\t__SERIES80_2X__\n" if $S80SDK =~ /^2\./;
89 if ($SDK_VARIANT eq 'UIQ') {
90 print $fh "MACRO\t__UIQ__\n";
91 print $fh "MACRO\t__UIQ_1X__\n" if $UIQSDK =~ /^1\./;
92 print $fh "MACRO\t__UIQ_2X__\n" if $UIQSDK =~ /^2\./;
95 @c = map { glob } qw(*.c); # Find the .c files.
96 @c = map { lc } @c; # Lowercase the names.
97 @c = grep { !/malloc\.c/ } @c; # Use the system malloc.
98 @c = grep { !/main\.c/ } @c; # main.c must be explicit.
99 push @c, map { lc } @x;
100 @c = map { s:^\.\./::; $_ } @c; # Remove the leading ../
101 @c = map { $c{$_}++ } @c; # Uniquefy.
102 @c = sort keys %c; # Beautify.
105 print $fh "SOURCE\t\t$_\n";
110 USERINCLUDE $CWD\\ext\\DynaLoader
111 USERINCLUDE $CWD\\symbian
112 SYSTEMINCLUDE \\epoc32\\include\\libc
113 SYSTEMINCLUDE \\epoc32\\include
120 if ( $miniperl || $perl || $type eq 'dll' ) {
127 if ($SDK_VARIANT =~ /^S[68]0$/) {
129 LIBRARY commonengine.lib
132 if (defined $S60SDK) {
135 LIBRARY commondialogs.lib
138 if (defined $S80SDK) {
146 if (defined $UIQSDK) {
154 if ( $type eq 'exe' ) {
156 STATICLIBRARY ecrt0.lib
172 MACRO PERL_IMPLICIT_CONTEXT
174 unless ( $miniperl || $perl ) {
176 MACRO PERL_GLOBAL_STRUCT
177 MACRO PERL_GLOBAL_STRUCT_PRIVATE
178 RESOURCE symbian\\PerlUi.rss
184 warn "$0: failed to open $mmp for writing: $!\n";
189 if ( open( BLD_INF, ">bld.inf" ) ) {
191 push @unclean, "bld.inf";
192 print BLD_INF <<__EOF__;
197 for (@mmp) { print BLD_INF $_, "\n" }
201 warn "$0: failed to open bld.inf for writing: $!\n";
208 if ( open( CONFIG_SH, "symbian/config.sh" ) ) {
209 while (<CONFIG_SH>) {
210 if (/^(\w+)=['"]?(.*?)["']?$/) {
211 my ( $var, $val ) = ( $1, $2 );
212 $val =~ s/x.y.z/$R_V_SV/gi;
213 $val =~ s/thumb/$ARM/gi;
214 $val = "'$SYMBIAN_VERSION'" if $var eq 'osvers';
215 $val = "'$SDK_VERSION'" if $var eq 'sdkvers';
216 $config{$var} = $val;
222 warn "$0: failed to open symbian\\config.sh for reading: $!\n";
226 sub create_config_h {
228 if ( open( CONFIG_H, ">config.h" ) ) {
229 print "\tconfig.h\n";
230 push @unclean, "config.h";
231 if ( open( CONFIG_H_SH, "config_h.SH" ) ) {
232 while (<CONFIG_H_SH>) {
233 last if /\#ifndef _config_h_/;
235 print CONFIG_H <<__EOF__;
237 * Package name : perl
238 * Source directory : .
239 * Configuration time:
241 * Target system : symbian
246 while (<CONFIG_H_SH>) {
247 last if /!GROK!THIS/;
248 s/\$(\w+)/exists $config{$1} ? $config{$1} : (warn "$0: config.sh missing '$1'\n", "")/eg;
249 s/^#undef\s+(\S+).+/#undef $1/g;
256 warn "$0: failed to open ../config_h.SH for reading: $!\n";
261 warn "$0: failed to open config.h for writing: $!\n";
265 sub create_DynaLoader_cpp {
266 print "\text\\DynaLoader\\DynaLoader.cpp\n";
268 q[perl -Ilib lib\ExtUtils\xsubpp ext\DynaLoader\dl_symbian.xs >ext\DynaLoader\DynaLoader.cpp]
270 or die "$0: creating DynaLoader.cpp failed: $!\n";
271 push @unclean, 'ext\DynaLoader\DynaLoader.cpp';
275 sub create_symbian_port_h {
276 print "\tsymbian\\symbian_port.h\n";
277 if ( open( SYMBIAN_PORT_H, ">symbian/symbian_port.h" ) ) {
278 my ($sdkmajor, $sdkminor);
279 if ($SDK_VARIANT eq 'S60') {
280 $S60SDK =~ /^(\d+)\.(\d+)$/;
281 ($sdkmajor, $sdkminor) = ($1, $2);
283 if ($SDK_VARIANT eq 'S80') {
284 $S80SDK =~ /^(\d+)\.(\d+)$/;
285 ($sdkmajor, $sdkminor) = ($1, $2);
287 if ($SDK_VARIANT eq 'UIQ') {
288 $UIQSDK =~ /^(\d+)\.(\d+)$/;
289 ($sdkmajor, $sdkminor) = ($1, $2);
291 print SYMBIAN_PORT_H <<__EOF__;
292 /* Copyright (c) 2004-2005, Nokia. All rights reserved. */
294 #ifndef __symbian_port_h__
295 #define __symbian_port_h__
297 #define PERL_SYMBIANPORT_MAJOR $PORT{dll}->{MAJOR}
298 #define PERL_SYMBIANPORT_MINOR $PORT{dll}->{MINOR}
299 #define PERL_SYMBIANPORT_PATCH $PORT{dll}->{PATCH}
301 #define PERL_SYMBIANSDK_FLAVOR L"$SDK_VARIANT"
302 #define PERL_SYMBIANSDK_MAJOR $sdkmajor
303 #define PERL_SYMBIANSDK_MINOR $sdkminor
305 #endif /* #ifndef __symbian_port_h__ */
307 close(SYMBIAN_PORT_H);
308 push @unclean, 'symbian\symbian_port.h';
311 warn "$0: failed to open symbian/symbian_port.h for writing: $!\n";
315 sub create_perlmain_c {
316 print "\tperlmain.c\n";
318 q[perl -ne "print qq[ char *file = __FILE__;\n] if /dXSUB_SYS/;print;print qq[ newXS(\"DynaLoader::boot_DynaLoader\", boot_DynaLoader, file);\n] if /dXSUB_SYS/;print qq[EXTERN_C void boot_DynaLoader (pTHX_ CV* cv);\n] if /Do not delete this line/" miniperlmain.c > perlmain.c]
320 or die "$0: Creating perlmain.c failed: $!\n";
321 push @unclean, 'perlmain.c';
324 sub create_PerlApp_pkg {
325 print "\tsymbian\\PerlApp.pkg\n";
326 if ( open( PERLAPP_PKG, ">symbian\\PerlApp.pkg" ) ) {
329 qq[;Supports Series 60 v0.9\n(0x101F6F88), 0, 0, 0, {"Series60ProductID"}\n] :
331 qq[;Supports Series 80 v2.0\n(0x101F8ED2), 0, 0, 0, {"Series80ProductID"}\n] :
332 defined $UIQSDK && $SDK_VERSION =~ /^(\d)\.(\d)$/ ?
333 qq[;Supports UIQ v2.1\n(0x101F617B), $1, $2, 0, {"UIQ21ProductID"}\n] :
334 ";Supports Series NN";
336 if (($SDK_VARIANT eq 'S60' && $SDK_VERSION ne '1.2' || $WIN eq 'winscw') || defined $S80SDK) { # Do only if not in S60 1.2 VC.
337 $APPS =~ s!\\epoc32\\release\\(.+)\\$UARM$!\\epoc32\\data\\z\\system\\apps\\PerlApp!i;
339 # TODO: in S60 3.0 there will be no more recognizers.
340 my $mdl = qq["$UREL\\PerlRecog.mdl"-"!:\\system\\recogs\\PerlRecog.mdl";];
341 my $AIF = $SDK_VARIANT =~ /^S[68]0/ ? qq["$APPS\\PerlApp.aif"-"!:\\system\\apps\\PerlApp\\PerlApp.aif"] : "";
342 print PERLAPP_PKG <<__EOF__;
343 ; !!!!!! DO NOT EDIT THIS FILE !!!!!!
344 ; This file is built by symbian\\config.pl.
345 ; Any changes made here will be lost!
349 ; Note that the demo_pl needs to be run to create the demo .pl scripts.
354 ; Standard SIS file header
355 #{"PerlApp"},(0x102015F6),0,2,0
360 "$UREL\\PerlApp.APP"-"!:\\system\\apps\\PerlApp\\PerlApp.app"
362 "$APPS\\PerlApp.rsc"-"!:\\system\\apps\\PerlApp\\PerlApp.rsc"
365 if ( open( DEMOS, "perl symbian\\demo_pl list |" ) ) {
368 print PERLAPP_PKG qq["$_"-"!:\\Perl\\$_"\n];
375 die "$0: symbian\\PerlApp.pkg: $!\n";
377 push @unclean, 'symbian\PerlApp.pkg';
380 print "Creating...\n";
383 'miniperlmain.c', 'symbian\symbian_stubs.c',
384 'symbian\PerlBase.cpp',
385 'symbian\PerlUi.cpp',
386 'symbian\PerlUtil.cpp',
387 'symbian\symbian_utils.cpp',
391 'perlmain.c', 'symbian\symbian_stubs.c',
392 'symbian\symbian_utils.cpp',
393 'symbian\PerlBase.cpp',
394 'symbian\PerlUi.cpp',
395 'symbian\PerlUtil.cpp',
396 'ext\DynaLoader\DynaLoader.cpp',
400 "perl$VERSION", 'dll',
401 'symbian\symbian_dll.cpp', 'symbian\symbian_stubs.c',
402 'symbian\symbian_utils.cpp',
403 'symbian\PerlBase.cpp',
404 'symbian\PerlUi.cpp',
405 'symbian\PerlUtil.cpp',
406 'ext\DynaLoader\DynaLoader.cpp',
412 create_symbian_port_h();
413 create_DynaLoader_cpp();
414 create_PerlApp_pkg();
416 if ( open( PERLAPP_MMP, ">symbian/PerlApp.mmp" ) ) {
419 push @MACRO, 'PERL_IMPLICIT_CONTEXT';
420 push @MACRO, 'MULTIPLICITY';
421 if (defined $S60SDK) {
422 push @MACRO, '__SERIES60__';
423 push @MACRO, '__SERIES60_1X__' if $S60SDK =~ /^1\./;
424 push @MACRO, '__SERIES60_2X__' if $S60SDK =~ /^2\./;
425 push @LIB, <<__EOF__;
427 LIBRARY commondialogs.lib
430 if (defined $S80SDK) {
431 push @MACRO, '__SERIES80__';
432 push @MACRO, '__SERIES80_1X__' if $S80SDK =~ /^1\./;
433 push @MACRO, '__SERIES80_2X__' if $S80SDK =~ /^2\./;
434 push @LIB, <<__EOF__;
441 if (defined $UIQSDK) {
442 push @MACRO, '__UIQ__';
443 push @MACRO, '__UIQ_1X__' if $UIQSDK =~ /^1\./;
444 push @MACRO, '__UIQ_2X__' if $UIQSDK =~ /^2\./;
445 push @LIB, <<__EOF__;
452 print PERLAPP_MMP <<__EOF__;
453 // !!!!!! DO NOT EDIT THIS FILE !!!!!!
454 // This file is built by symbian\\config.pl.
455 // Any changes made here will be lost!
458 UID 0x100039CE 0x102015F6
459 TARGETPATH \\system\\apps\\PerlApp
467 USERINCLUDE \\symbian\\perl\\$R_V_SV\\include
469 SYSTEMINCLUDE \\epoc32\\include
470 SYSTEMINCLUDE \\epoc32\\include\\libc
480 LIBRARY perl$VERSION.lib
485 for my $macro (@MACRO) {
486 print PERLAPP_MMP <<__EOF__;
491 if ($SDK_VARIANT =~ /^S[68]0$/) {
492 print PERLAPP_MMP <<__EOF__;
493 AIF PerlApp.aif . PerlAppAif.rss
497 push @unclean, 'symbian\PerlApp.mmp';
500 warn "$0: failed to create symbian\\PerlApp.mmp";
503 if ( open( MAKEFILE, ">Makefile" ) ) {
504 my $perl = "perl$VERSION";
505 my $windef1 = "$SYMBIAN_ROOT\\Epoc32\\Build$CWD\\$perl\\$WIN\\$perl.def";
506 my $windef2 = "..\\BWINS\\${perl}u.def";
507 my $armdef1 = "$SYMBIAN_ROOT\\Epoc32\\Build$CWD\\$perl\\$ARM\\$perl.def";
508 my $armdef2 = "..\\BMARM\\${perl}u.def";
509 my $MF = $WIN eq 'wins' ? 'vc6' : $WIN eq 'winscw' ? 'cw_ide' : "UNKNOWN";
510 print "\tMakefile\n";
511 print MAKEFILE <<__EOF__;
513 \@echo === Perl for Symbian ===
514 \@echo Useful targets:
515 \@echo all win arm clean
516 \@echo perldll.sis perlext.sis perlsdk.zip
523 build: rename_makedef build_${WIN} build_arm
525 @unclean: symbian\\config.pl
526 perl symbian\\config.pl
528 build_${WIN}: abld.bat perldll_${WIN}
530 build_vc6: abld.bat perldll_wins
532 build_vc7: abld.bat perldll_wins
534 build_cw: abld.bat perldll_winscw
536 build_arm: abld.bat perl_arm miniperl_arm perldll_arm
538 miniperl_win miniperl_${WIN}: miniperl.mmp abld.bat rename_makedef
539 abld build ${WIN} udeb miniperl
541 miniperl_arm: miniperl.mmp abld.bat rename_makedef
542 abld build \$(ARM) $UARM miniperl
544 miniperl: miniperl_${WIN} miniperl_arm
546 perl: perl_${WIN} perl_arm
548 perl_win perl_${WIN}: perl.mmp abld.bat rename_makedef
549 abld build ${WIN} perl
551 perl_arm: perl.mmp abld.bat rename_makedef
552 abld build \$(ARM) $UARM perl
554 perldll_win perldll_${WIN}: perl${VERSION}_${WIN} freeze_${WIN} perl${VERSION}_${WIN}
556 perl${VERSION}_win perl${VERSION}_${WIN}: perl$VERSION.mmp abld.bat rename_makedef
557 abld build ${WIN} perl$VERSION
559 perldll_arm: perl${VERSION}_arm freeze_arm perl${VERSION}_arm
561 perl${VERSION}_arm: perl$VERSION.mmp abld.bat rename_makedef
562 abld build \$(ARM) $UARM perl$VERSION
564 perldll perl$VERSION: perldll_${WIN} perldll_arm
566 win ${WIN}: miniperl_${WIN} perl_${WIN} perldll_${WIN}
568 thumb arm: miniperl_arm perl_arm perldll_arm
571 -ren makedef.pl nomakedef.pl
573 # Symbian SDK has a makedef.pl of its own,
574 # and we don't need Perl's.
576 -ren nomakedef.pl makedef.pl
578 symbian\\PerlUi.rss: symbian\\PerlUi$SDK_VARIANT.rss
579 copy symbian\\PerlUi$SDK_VARIANT.rss symbian\\PerlUi.rss
581 abld.bat abld: bld.inf symbian\\PerlUi.rss
584 vc6: win.mf vc6.mf build_vc6
586 vc7: win.mf vc7.mf build_vc7
588 cw: win.mf cw.mf build_cw
590 ${WIN}_miniperl.mf: abld.bat symbian\\config.pl
591 abld makefile ${MF} miniperl
592 echo > ${WIN}_miniperl.mf
594 ${WIN}_perl.mf: abld.bat symbian\\config.pl
595 abld makefile ${MF} perl
596 echo > ${WIN}_perl.mf
598 ${WIN}_${VERSION}.mf: abld.bat symbian\\config.pl
599 abld makefile ${MF} perl${VERSION}
600 echo > ${WIN}_${VERSION}.mf
603 cd symbian; make ${WIN}.mf
605 ${WIN}.mf: ${WIN}_miniperl.mf ${WIN}_perl.mf ${WIN}_${VERSION}.mf symbian\\${WIN}.mf
607 arm_miniperl.mf: abld.bat symbian\\config.pl
608 echo > arm_miniperl.mf
610 arm_perl.mf: abld.bat symbian\\config.pl
613 arm_${VERSION}.mf: abld.bat symbian\\config.pl
614 echo > arm_${VERSION}.mf
616 arm.mf: arm_miniperl.mf arm_perl.mf arm_${VERSION}.mf
621 vc6.mf: abld.bat symbian\\config.pl
625 vc7.mf: abld.bat symbian\\config.pl
629 cw.mf: abld.bat symbian\\config.pl
633 PM = lib\\Config.pm lib\\Cross.pm lib\\lib.pm ext\\DynaLoader\\DynaLoader.pm ext\\DynaLoader\\XSLoader.pm ext\\Errno\\Errno.pm
634 POD = lib\\Config.pod
638 XLIB = -Ixlib\\symbian
640 XSBOPT = --win=\$(WIN) --arm=\$(ARM)
643 copy symbian\\config.sh config.sh
644 perl -pi.bak -e "s:x\\.y\\.z+:$R_V_SV:g" config.sh
645 perl \$(XLIB) configpm --cross=symbian
646 copy xlib\\symbian\\Config.pm lib\\Config.pm
647 perl -pi.bak -e "s:x\\.y\\.z:$R_V_SV:g" lib\\Config.pm
648 perl -pi.bak -e "s:5\\.\\d+\\.\\d+:$R_V_SV:g" lib\\Config.pm
649 -perl -pi.bak -e "s:x\\.y\\.z:$R_V_SV:g" xlib\\symbian\\Config_heavy.pl
654 ext\\DynaLoader\\DynaLoader.pm:
655 -del /f ext\\DynaLoader\\DynaLoader.pm
656 perl -Ixlib\\symbian ext\\DynaLoader\\DynaLoader_pm.PL
657 perl -pi.bak -e "s/__END__//" DynaLoader.pm
658 copy /y DynaLoader.pm ext\\DynaLoader\\DynaLoader.pm
659 -del /f DynaLoader.pm DynaLoader.pm.bak
661 ext\\DynaLoader\\XSLoader.pm:
662 perl \$(XLIB) symbian\\xsbuild.pl \$(XSBOPT) XSLoader
664 ext\\Errno\\Errno.pm:
665 perl \$(XLIB) symbian\\xsbuild.pl \$(XSBOPT) Errno
667 miniperlexe.sis: miniperl_arm symbian\\makesis.pl
668 perl \$(XLIB) symbian\\makesis.pl miniperl
670 perlexe.sis: perl_arm symbian\\makesis.pl
671 perl \$(XLIB) symbian\\makesis.pl perl
674 allsis: all miniperlexe.sis perlexe.sis perldll.sis perllib.sis perlext.sis perlapp.sis
676 perldll.sis perl$VERSION.sis: perldll_arm pm symbian\\makesis.pl
677 perl \$(XLIB) symbian\\makesis.pl perl${VERSION}dll
679 perl${VERSION}lib.sis perllib.sis: \$(PM)
680 perl \$(XLIB) symbian\\makesis.pl perl${VERSION}lib
682 perl${VERSION}ext.sis perlext.sis: perldll_arm buildext_sis
683 perl symbian\\makesis.pl perl${VERSION}ext
685 EXT = Compress::Zlib Cwd Data::Dumper Devel::Peek Digest::MD5 Errno Fcntl File::Glob Filter::Util::Call IO List::Util MIME::Base64 PerlIO::scalar PerlIO::via SDBM_File Socket Storable Time::HiRes XSLoader attrs
687 buildext: perldll symbian\\xsbuild.pl lib\\Config.pm
688 perl \$(XLIB) symbian\\xsbuild.pl \$(XSBOPT) \$(EXT)
690 buildextcpp: perldll symbian\\xsbuild.pl lib\\Config.pm
691 perl \$(XLIB) symbian\\xsbuild.pl --csuffix .cpp \$(XSBOPT) \$(EXT)
693 buildext_sis: perldll.sis symbian\\xsbuild.pl lib\\Config.pm
694 perl \$(XLIB) symbian\\xsbuild.pl \$(XSBOPT) --sis \$(EXT)
696 buildextcpp_sis: perldll.sis symbian\\xsbuild.pl lib\\Config.pm
697 perl \$(XLIB) symbian\\xsbuild.pl --csuffix .cpp \$(XSBOPT) --sis \$(EXT)
699 cleanext: symbian\\xsbuild.pl
700 perl \$(XLIB) symbian\\xsbuild.pl \$(XSBOPT) --clean \$(EXT)
702 distcleanext: symbian\\xsbuild.pl
703 perl \$(XLIB) symbian\\xsbuild.pl \$(XSBOPT) --distclean \$(EXT)
705 sis makesis: miniperl perl perldll pm buildext perlapp.sis
706 perl \$(XLIB) symbian\\makesis.pl
708 APIDIR = \\Symbian\\perl\\$R_V_SV
711 -mkdir \\Symbian\\perl
712 -mkdir \\Symbian\\perl\\$R_V_SV
713 -mkdir \$(APIDIR)\\include
714 -mkdir \$(APIDIR)\\include\\symbian
715 -mkdir \$(APIDIR)\\lib
716 -mkdir \$(APIDIR)\\lib\\ExtUtils
717 -mkdir \$(APIDIR)\\pod
718 -mkdir \$(APIDIR)\\bin
720 copy /y *.h \$(APIDIR)\\include
721 -copy /y *.inc \$(APIDIR)\\include
722 copy /y lib\\ExtUtils\\xsubpp \$(APIDIR)\\lib\\ExtUtils
723 copy /y lib\\ExtUtils\\typemap \$(APIDIR)\\lib\\ExtUtils
724 copy /y lib\\ExtUtils\\ParseXS.pm \$(APIDIR)\\lib\\ExtUtils
725 copy /y symbian\\xsbuild.pl \$(APIDIR)\\bin
726 copy /y symbian\\sisify.pl \$(APIDIR)\\bin
727 copy /y symbian\\PerlBase.h \$(APIDIR)\\include
728 copy /y symbian\\PerlUi.h \$(APIDIR)\\include
729 copy /y symbian\\PerlUtil.h \$(APIDIR)\\include
730 copy /y symbian\\symbian*.h \$(APIDIR)\\include\\symbian
731 copy /y symbian\\PerlBase.pod \$(APIDIR)\\pod
732 copy /y symbian\\PerlUtil.pod \$(APIDIR)\\pod
734 RELDIR = $SYMBIAN_ROOT\\epoc32\\release
735 RELWIN = \$(RELDIR)\\\$(WIN)\\udeb
736 RELARM = \$(RELDIR)\\\$(ARM)\\$UARM
737 SDKZIP = perl${VERSION}sdk.zip
740 \$(SDKZIP) perlsdk.zip: perldll sdkinstall
741 -del /f perl${VERSION}sdk.zip
742 zip -r perl${VERSION}sdk.zip \$(RELWIN)\\perl$VERSION.* \$(RELARM)\\perl$VERSION.* \$(APIDIR)
743 \@echo perl${VERSION}sdk.zip created.
745 PERLSIS = perl${VERSION}.SIS perl${VERSION}lib.SIS perl${VERSION}ext.SIS
746 ALLSIS = \$(PERLSIS) perlapp.sis
747 ETC = README.symbian symbian\\PerlBase.pod symbian\\PerlUtil.pod symbian\\sisify.pl symbian\\TODO
749 perl${VERSION}dist.zip perldist.zip: \$(ALLSIS) \$(SDKZIP) \$(ETC)
750 -del /f perl${VERSION}dist.zip
751 zip -r perl${VERSION}dist.zip \$(ALLSIS) \$(SDKZIP) \$(ETC)
753 perlapp: sdkinstall perlapp_${WIN} perlapp_arm
755 perlapp_arm_minimal sisify_hex perlappmin.hex perlrscmin.hex: sdkinstall config.h
756 cd symbian; make perlapp_arm USERDEFS=-DCreatePerlAppMinimal
757 perl symbian\\hexdump.pl
759 perlapp_win perlapp_${WIN}: config.h
760 cd symbian; make perlapp_${WIN}
762 perlapp_arm: config.h
763 cd symbian; make perlapp_arm
766 cd symbian; make clean
768 perlapp_demo_extract:
769 cd symbian; make perlapp_demo_extract
771 perlapp.sis: perlapp_arm
772 cd symbian; make perlapp.sis
775 cd symbian; zip perlapp.zip PerlApp.* PerlRecog.* PerlBase.* PerlUtil.* demo_pl
777 zip: perlsdk.zip perlapp.zip
779 freeze: freeze_${WIN} freeze_arm
782 abld freeze ${WIN} perl$VERSION
785 abld freeze \$(ARM) perl$VERSION
787 defrost: defrost_${WIN} defrost_arm
797 clean_${WIN}: abld.bat
803 clean: clean_${WIN} clean_arm rerename_makedef
806 -del /f lib\\Config.pm.bak
807 -del /f xlib\\symbian\\Config_heavy.pl
810 -del /f DynaLoader.pm ext\\DynaLoader\\DynaLoader.pm
811 -del /f ext\\DynaLoader\\Makefile
812 -del /f ext\\SDBM_File\\sdbm\\Makefile
813 -del /f symbian\\*.lst
814 -del /f abld.bat @unclean *.pkg *.sis *.zip
815 -del /f symbian\\abld.bat symbian\\*.sis symbian\\*.zip
816 -del /f symbian\\perl5*.pkg symbian\\miniperl.pkg
817 -del arm_*.mf ${WIN}_*.mf vc*.mf cw*.mf
818 -del symbian\\Makefile
819 -del symbian\\PerlUi.rss symbian\\PerlApp.rss
820 -del perlappmin.hex perlrscmin.hex
821 -perl symbian\\xsbuild.pl \$(XSBOPT) --clean \$(EXT)
822 -rmdir /s /q perl${VERSION}_Data
823 -cd symbian; make clean
825 reallyclean: abld.bat
828 distclean: defrost reallyclean clean
829 -perl symbian\\xsbuild.pl \$(XSBOPT) --distclean \$(EXT)
830 -del /f config.h config.sh.bak symbian\\symbian_port.h
831 -del /f Makefile symbian\\PerlApp.mmp
833 -del /f *.cwlink *.resources *.pref
834 -del /f perl${VERSION}.xml perl${VERSION}.mcp uid.cpp
836 cd symbian; make distclean
837 -del /f symbian\\Makefile
842 warn "$0: failed to create Makefile: $!\n";
845 if ( open( MAKEFILE, ">symbian/Makefile")) {
846 my $wrap = defined $S60SDK && $S60SDK eq '1.2' && $WIN ne '${WIN}cw';
847 my $ABLD = $wrap ? 'perl b.pl': 'abld';
848 print "\tsymbian/Makefile\n";
849 my $MF = $WIN eq 'wins' ? 'vc6' : $WIN eq 'winscw' ? 'cw_ide' : "UNKNOWN";
850 print MAKEFILE <<__EOF__;
859 perlapp_${WIN}: abld.bat ..\\config.h PerlApp.h PerlApp.cpp
860 copy PerlUi$SDK_VARIANT.rss PerlApp.rss
862 \$(ABLD) build ${WIN} udeb
864 perlapp_arm: ..\\config.h PerlApp.h PerlApp.cpp
865 copy PerlUi$SDK_VARIANT.rss PerlApp.rss
867 \$(ABLD) build ${ARM} $UARM
876 perlapp_demo_extract:
879 perlapp.sis: perlapp_arm perlapp_demo_extract
882 copy /y perlapp.SIS ..\\perlapp.SIS
885 -perl demo_pl cleanup
894 -del /f *.cwlink *.resources *.pref
895 -del /f PerlApp.xml PerlApp.mcp uid.cpp
896 -rmdir /s /q PerlApp_Data
901 if ( open( B_PL, ">symbian/b.pl")) {
902 print B_PL <<'__EOF__';
905 # nmake doesn't like MFLAGS and MAKEFLAGS being set to -w and w.
907 delete $ENV{MAKEFLAGS};
909 system("abld @ARGV");
913 warn "$0: failed to create symbian/b.pl: $!\n";
917 warn "$0: failed to create symbian/Makefile: $!\n";
920 print "Deleting...\n";
922 # Do not delete config.h here.
925 "xlib\\symbian\\Config.pm",
926 "xlib\\symbian\\Config_heavy.pl",
927 "symbian\\PerlUi.rss",
928 "symbian\\PerlApp.rss",